Skip to content

Instantly share code, notes, and snippets.

/proc/trange(rad = 0, turf/centre = null) //alternative to range (ONLY processes turfs and thus less intensive)
if(!centre)
return
var/turf/x1y1 = locate(((centre.x-rad)<1 ? 1 : centre.x-rad),((centre.y-rad)<1 ? 1 : centre.y-rad),centre.z)
var/turf/x2y2 = locate(((centre.x+rad)>world.maxx ? world.maxx : centre.x+rad),((centre.y+rad)>world.maxy ? world.maxy : centre.y+rad),centre.z)
return block(x1y1,x2y2)
#define DECAY_RATE 0.1
var/list/to_process = list(
datum/rad_handler
var/list/sources = list()
var/list/irradiated = list()
datum/rad_handler/process()
//Chemical Reagents - Initialises all /datum/reagent into a list indexed by reagent id
/proc/initialize_chemical_reagents()
var/paths = typesof(/datum/reagent) - /datum/reagent
chemical_reagents_list = list()
for(var/path in paths)
var/datum/reagent/D = new path()
if(!D.name)
continue
chemical_reagents_list[D.id] = D
@BlueNexus
BlueNexus / ireland.py
Last active July 19, 2016 12:58
Determines registration date and location when given an irish license plate number
import string
index_codes = {
"C":"Cork", "CE":"Clare",
"CN":"Cavan", "CW":"Carlow",
"D":"Dublin", "DL":"Donegal",
"G":"Galway", "KE":"Kildare",
"KK":"Kilkenny", "KY":"Kerry",
"L":"Limerick", "LD":"Longford",
"LH":"Louth", "LM":"Leitrim",
@BlueNexus
BlueNexus / rot13.py
Last active July 19, 2016 13:00
44-line Python rot13 script
import string
charset = list(string.ascii_lowercase)
def rem_numbers(source):
new_string = []
to_remove = list(string.digits)
source = list(source.lower())
for char in source:
if char not in to_remove: