Lines Matching +full:fill +full:- +full:range
4 A curses-based version of Conway's Game of Life.
8 R : Fill the board randomly
30 display(update_board) -- If update_board is true, compute the
33 erase() -- clear the entire board
34 make_random() -- fill the board randomly
35 set(y,x) -- set the given cell to Live; doesn't refresh the screen
36 toggle(y,x) -- change the given cell from live to dead, or vice
43 scr -- curses screen object to use for display
44 char -- character used to render live cells (default: '*')
49 self.X, self.Y = X - 2, Y - 2 - 1
54 border_line = '+' + (self.X * '-') + '+'
57 for y in range(0, self.Y):
65 raise ValueError("Coordinates out of range %i,%i" % (y, x))
71 raise ValueError("Coordinates out of range %i,%i" % (y, x))
93 for i in range(0, M):
94 for j in range(0, N):
104 for i in range(0, M):
105 L = range(max(0, i - 1), min(M, i + 2))
106 for j in range(0, N):
109 for k in range(max(0, j - 1), min(N, j + 2)):
113 s -= live
136 "Fill the board with a random pattern"
138 for i in range(0, self.X):
139 for j in range(0, self.Y):
156 # If color, then light the menu up :-)
162 'E)rase the board, R)andom fill, S)tep once or C)ontinuously, Q)uit')
170 menu_y = (stdscr_y - 3) - 1
187 subwin = stdscr.subwin(stdscr_y - 3, stdscr_x, 0, 0)
207 # Activate nodelay mode; getch() will return -1
212 if c != -1:
236 ypos -= 1
240 xpos -= 1
247 xpos = mouse_x - 1
248 ypos = mouse_y - 1