ID:2726085
 
world/view=33
world/fps=30
world/icon_size=16

proc/simulate()
var max_x = world.maxx
var max_y = world.maxy
for()
world.name = "CPU: [world.cpu]%"
sleep(1)
if(play == 0){continue}
var list/grida = grid(max_x,max_y)
var list/gridb[max_x][max_y]
var x,y,r,turf/t
for(y = 1 to max_y)
for(x = 1 to max_x)
switch(grida[x][y].icon_state)
if("1")
r = 0
for(t in orange(1,grida[x][y]))
if(t.icon_state=="1"){r++}
if(2 > r)
r = 0
else if(r > 3)
r = 0
else
r = 1
gridb[x][y] = r
if("0")
r = 0
for(t in orange(1,grida[x][y]))
if(t.icon_state=="1"){r++}
gridb[x][y] = (r==3) ? 1 : 0

for(y = 1 to max_y)
for(x = 1 to max_x)
grida[x][y].icon_state = "[gridb[x][y]]"

proc/grid(max_x,max_y)
var x,y,list/grid[max_x][max_y]
for(y = 1 to max_y)
for(x = 1 to max_x)
grid[x][y] = locate(x,y,1)
return grid

turf/icon='cell.dmi'
turf/icon_state = "0"
turf/maptext_width = 128
turf/maptext_height = 128

turf/Click()
switch(icon_state)
if("0")icon_state="1"
if("1")icon_state="0"

var play = FALSE

client/Topic(_)
switch(_)
if("play"){play=TRUE}
if("stop"){play=FALSE}

mob/Login()
..()
src << "<a href=?play>PLAY</a>"
src << "<a href=?stop>STOP</a>"
simulate()



All you need to do is create a map.dmm file and a icon.dmi file named 'cell.dmi' with a icon_state for both "1" and "0".

The size of the simulation depends on your map's size.