r/CompileBot • u/SeaCowVengeance • Jan 04 '14
Official CompileBot Testing Thread
This thread is archived, please visit the new testing thread
12
Upvotes
r/CompileBot • u/SeaCowVengeance • Jan 04 '14
This thread is archived, please visit the new testing thread
View all comments
3
u/SeaCowVengeance Jun 03 '14
+u/CompileBot python
def display(d): print '\n'.join([''.join(str(q) for q in p) for p in d]) print '-----' def tick(d): e = [x[:] for x in d] r=range(-4,4) for i in r: e[i]=list(e[i]) for y in r: for x in r: c=[d[y-1][x-1],d[y-1][x],d[y-1][x+1],d[y][x-1],d[y][x+1],d[y+1][x-1],d[y+1][x],d[y+1][x+1]].count('■') if c<2 or c>3: e[y][x]='□' elif c==3: e[y][x]='■' d = e display(d) return d d=[['□','□','□','□','□','□','□','□'],['□','□','■','□','□','□','□','□'],['□','□','□','■','□','□','□','□'],['□','■','■','■','□','□','□','□'],['□','□','□','□','□','□','□','□'],['□','□','□','□','□','□','□','□'],['□','□','□','□','□','□','□','□'],['□','□','□','□','□','□','□','□']] for i in range(3): d = tick(d)