This is a 7 line vertion of John Conway's 'Game of life'.
Game of life is a simple set of 4 rules which govern 'cells' in a life like way.
1. Any live cell with fewer than two live neighbours dies, as if caused by under-population.
2. Any live cell with more than three live neighbours dies, as if by overcrowding.
3. Any live cell with two or three live neighbours lives on to the next generation.
4. Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
You input the starting pattern using the mouse (left click creates a live cell, right click removes a live cell) and once a pattern has been entered, press the spacebar and the pattern will then evolve based on the rules above.
There is a good wikipedia article on it which goes into much more detail about it.
sync on:sync rate 10:size=70:ss=10:dim cell(size,size):dim newcell(size,size):do:if spacekey()=0:for x=1 to size:for y=1 to size:newcell(x,y)=0:next y:next x:endif:while spacekey()=0
if mousex()>size*ss:position mouse size*ss,mousey():endif:if mousey()>size*ss:position mouse mousex(),size*ss:endif:x#=mousex():y#=mousey():if mouseclick()=1:cell(int(x#/ss),int(y#/ss))=1
box int(mousex()/ss)*ss,int(mousey()/ss)*ss,(int(mousex()/ss)*ss)+ss,(int(mousey()/ss)*ss)+ss:endif:if mouseclick()=2:cell(int(x#/ss),int(y#/ss))=0:ink 0,0:box int(mousex()/ss)*ss,int(mousey()/ss)*ss,(int(mousex()/ss)*ss)+ss,(int(mousey()/ss)*ss)+ss
ink rgb(255,255,255),0:endif:gosub grid:sync:endwhile:cls 0:for x=1 to size-1:for y=1 to size-1:cellnum=0:for x2=x-1 to x+1:for y2=y-1 to y+1:if x2=x and y2=y:y2=y+1:endif:if cell(x2,y2)=1:inc cellnum:endif:next y2:next x2:if cellnum<2:newcell(x,y)=0
endif:if cellnum>3:newcell(x,y)=0:endif:if cell(x,y)=1:if cellnum=2 or cellnum=3:newcell(x,y)=1:endif:endif:if cellnum=3:newcell(x,y)=1:endif:next y:next x:for x=1 to size:for y=1 to size:cell(x,y)=newcell(x,y):if cell(x,y)=1
box x*ss,y*ss,(x*ss)+ss,(y*ss)+ss:endif:next y:next x:gosub grid:sync:loop
grid:ink rgb(0,0,100),0:for x=1 to size*ss step ss:line x-1,0,x-1,size*ss:next x:for y=1 to size*ss step ss:line 0,y-1,size*ss,y-1:next y:ink rgb(255,255,255),0:return
There is no such thing as "Too Fast!"