From: Kevin A. <ka...@us...> - 2004-09-28 01:45:35
|
Update of /cvsroot/pythoncard/PythonCard/samples/life In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3519/samples/life Modified Files: life.py Log Message: minor optimization Index: life.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/life/life.py,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** life.py 15 Aug 2004 17:34:56 -0000 1.41 --- life.py 28 Sep 2004 01:45:17 -0000 1.42 *************** *** 154,158 **** self.grid = newgrid self.displayGeneration() ! wx.SafeYield(self) def displayGeneration(self): --- 154,158 ---- self.grid = newgrid self.displayGeneration() ! #wx.SafeYield(self) def displayGeneration(self): *************** *** 176,188 **** if grid[cell]: population += 1 ! points.append((cell[0] * self.scale, cell[1] * self.scale)) canvas.drawPointList(points) else: rects = [] for cell in grid: if grid[cell]: population += 1 ! rects.append((cell[0] * self.scale, cell[1] * self.scale, width, width)) ! #canvas.drawRectangle(cell[0] * self.scale, cell[1] * self.scale, width, width) canvas.drawRectangleList(rects) --- 176,189 ---- if grid[cell]: population += 1 ! points.append((cell[0], cell[1])) canvas.drawPointList(points) else: rects = [] + scale = self.scale for cell in grid: if grid[cell]: population += 1 ! rects.append((cell[0] * scale, cell[1] * scale, width, width)) ! #canvas.drawRectangle(cell[0] * scale, cell[1] * scale, width, width) canvas.drawRectangleList(rects) |