#!/local/bin/python from whrandom import randint from time import sleep from curses import * class cell: cellx=celly=0 def __init__(self,x,y): self.alive=self.new=0 self.x=x self.y=y self.n=self.ne=self.nw=self.w=self.e=self.sw=self.se=self.e=0 def setxy(self,x,y): global cellx,celly cellx=x celly=y def map(self,U): global cellx,celly nx=(self.x+cellx-1)%cellx sx=(self.x+1)%cellx wy=(self.y+celly-1)%celly ey=(self.y+1)%celly self.w=U[(self.x*celly)+wy] self.e=U[(self.x*celly)+ey] self.n=U[(nx*celly)+self.y] self.s=U[(sx*celly)+self.y] self.nw=U[(nx*celly)+wy] self.ne=U[(nx*celly)+ey] self.sw=U[(sx*celly)+wy] self.se=U[(sx*celly)+ey] def reinit(self,rate): i=randint(0,100) if i