Benjamin Peterson | 90f5ba5 | 2010-03-11 22:53:45 +0000 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 2 | |
Georg Brandl | 856898b | 2010-12-30 22:11:50 +0000 | [diff] [blame] | 3 | """ |
| 4 | A curses-based version of Conway's Game of Life. |
| 5 | |
| 6 | An empty board will be displayed, and the following commands are available: |
| 7 | E : Erase the board |
| 8 | R : Fill the board randomly |
| 9 | S : Step for a single generation |
| 10 | C : Update continuously until a key is struck |
| 11 | Q : Quit |
| 12 | Cursor keys : Move the cursor around the board |
| 13 | Space or Enter : Toggle the contents of the cursor's position |
| 14 | |
| 15 | Contributed by Andrew Kuchling, Mouse support and color by Dafydd Crosby. |
| 16 | """ |
| 17 | |
Andrew M. Kuchling | 9a62448 | 2002-04-10 14:50:16 +0000 | [diff] [blame] | 18 | import curses |
Georg Brandl | 856898b | 2010-12-30 22:11:50 +0000 | [diff] [blame] | 19 | import random |
| 20 | |
Andrew M. Kuchling | 9a62448 | 2002-04-10 14:50:16 +0000 | [diff] [blame] | 21 | |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 22 | class LifeBoard: |
| 23 | """Encapsulates a Life board |
| 24 | |
| 25 | Attributes: |
| 26 | X,Y : horizontal and vertical size of the board |
| 27 | state : dictionary mapping (x,y) to 0 or 1 |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 28 | |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 29 | Methods: |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 30 | display(update_board) -- If update_board is true, compute the |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 31 | next generation. Then display the state |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 32 | of the board and refresh the screen. |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 33 | erase() -- clear the entire board |
Georg Brandl | 856898b | 2010-12-30 22:11:50 +0000 | [diff] [blame] | 34 | make_random() -- fill the board randomly |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 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 |
| 37 | versa, and refresh the screen display |
| 38 | |
| 39 | """ |
| 40 | def __init__(self, scr, char=ord('*')): |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 41 | """Create a new LifeBoard instance. |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 42 | |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 43 | scr -- curses screen object to use for display |
| 44 | char -- character used to render live cells (default: '*') |
| 45 | """ |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 46 | self.state = {} |
| 47 | self.scr = scr |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 48 | Y, X = self.scr.getmaxyx() |
| 49 | self.X, self.Y = X-2, Y-2-1 |
| 50 | self.char = char |
| 51 | self.scr.clear() |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 52 | |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 53 | # Draw a border around the board |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 54 | border_line = '+'+(self.X*'-')+'+' |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 55 | self.scr.addstr(0, 0, border_line) |
Georg Brandl | 856898b | 2010-12-30 22:11:50 +0000 | [diff] [blame] | 56 | self.scr.addstr(self.Y+1, 0, border_line) |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 57 | for y in range(0, self.Y): |
| 58 | self.scr.addstr(1+y, 0, '|') |
| 59 | self.scr.addstr(1+y, self.X+1, '|') |
| 60 | self.scr.refresh() |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 61 | |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 62 | def set(self, y, x): |
| 63 | """Set a cell to the live state""" |
| 64 | if x<0 or self.X<=x or y<0 or self.Y<=y: |
Georg Brandl | 856898b | 2010-12-30 22:11:50 +0000 | [diff] [blame] | 65 | raise ValueError("Coordinates out of range %i,%i"% (y, x)) |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 66 | self.state[x,y] = 1 |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 67 | |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 68 | def toggle(self, y, x): |
| 69 | """Toggle a cell's state between live and dead""" |
Georg Brandl | 856898b | 2010-12-30 22:11:50 +0000 | [diff] [blame] | 70 | if x < 0 or self.X <= x or y < 0 or self.Y <= y: |
| 71 | raise ValueError("Coordinates out of range %i,%i"% (y, x)) |
| 72 | if (x, y) in self.state: |
| 73 | del self.state[x, y] |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 74 | self.scr.addch(y+1, x+1, ' ') |
| 75 | else: |
Georg Brandl | 856898b | 2010-12-30 22:11:50 +0000 | [diff] [blame] | 76 | self.state[x, y] = 1 |
Senthil Kumaran | c1d98d6 | 2010-11-25 14:56:44 +0000 | [diff] [blame] | 77 | if curses.has_colors(): |
Georg Brandl | 856898b | 2010-12-30 22:11:50 +0000 | [diff] [blame] | 78 | # Let's pick a random color! |
| 79 | self.scr.attrset(curses.color_pair(random.randrange(1, 7))) |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 80 | self.scr.addch(y+1, x+1, self.char) |
Senthil Kumaran | c1d98d6 | 2010-11-25 14:56:44 +0000 | [diff] [blame] | 81 | self.scr.attrset(0) |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 82 | self.scr.refresh() |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 83 | |
| 84 | def erase(self): |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 85 | """Clear the entire board and update the board display""" |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 86 | self.state = {} |
| 87 | self.display(update_board=False) |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 88 | |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 89 | def display(self, update_board=True): |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 90 | """Display the whole board, optionally computing one generation""" |
| 91 | M,N = self.X, self.Y |
| 92 | if not update_board: |
| 93 | for i in range(0, M): |
| 94 | for j in range(0, N): |
Collin Winter | 6f2df4d | 2007-07-17 20:59:35 +0000 | [diff] [blame] | 95 | if (i,j) in self.state: |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 96 | self.scr.addch(j+1, i+1, self.char) |
| 97 | else: |
| 98 | self.scr.addch(j+1, i+1, ' ') |
| 99 | self.scr.refresh() |
| 100 | return |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 101 | |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 102 | d = {} |
| 103 | self.boring = 1 |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 104 | for i in range(0, M): |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 105 | L = range( max(0, i-1), min(M, i+2) ) |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 106 | for j in range(0, N): |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 107 | s = 0 |
Collin Winter | 6f2df4d | 2007-07-17 20:59:35 +0000 | [diff] [blame] | 108 | live = (i,j) in self.state |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 109 | for k in range( max(0, j-1), min(N, j+2) ): |
| 110 | for l in L: |
Collin Winter | 6f2df4d | 2007-07-17 20:59:35 +0000 | [diff] [blame] | 111 | if (l,k) in self.state: |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 112 | s += 1 |
| 113 | s -= live |
| 114 | if s == 3: |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 115 | # Birth |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 116 | d[i,j] = 1 |
Senthil Kumaran | c1d98d6 | 2010-11-25 14:56:44 +0000 | [diff] [blame] | 117 | if curses.has_colors(): |
Georg Brandl | 856898b | 2010-12-30 22:11:50 +0000 | [diff] [blame] | 118 | # Let's pick a random color! |
| 119 | self.scr.attrset(curses.color_pair( |
| 120 | random.randrange(1, 7))) |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 121 | self.scr.addch(j+1, i+1, self.char) |
Senthil Kumaran | c1d98d6 | 2010-11-25 14:56:44 +0000 | [diff] [blame] | 122 | self.scr.attrset(0) |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 123 | if not live: self.boring = 0 |
| 124 | elif s == 2 and live: d[i,j] = 1 # Survival |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 125 | elif live: |
| 126 | # Death |
| 127 | self.scr.addch(j+1, i+1, ' ') |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 128 | self.boring = 0 |
| 129 | self.state = d |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 130 | self.scr.refresh() |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 131 | |
Georg Brandl | 856898b | 2010-12-30 22:11:50 +0000 | [diff] [blame] | 132 | def make_random(self): |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 133 | "Fill the board with a random pattern" |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 134 | self.state = {} |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 135 | for i in range(0, self.X): |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 136 | for j in range(0, self.Y): |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 137 | if random.random() > 0.5: |
| 138 | self.set(j,i) |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 139 | |
| 140 | |
| 141 | def erase_menu(stdscr, menu_y): |
| 142 | "Clear the space where the menu resides" |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 143 | stdscr.move(menu_y, 0) |
| 144 | stdscr.clrtoeol() |
| 145 | stdscr.move(menu_y+1, 0) |
| 146 | stdscr.clrtoeol() |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 147 | |
| 148 | def display_menu(stdscr, menu_y): |
| 149 | "Display the menu of possible keystroke commands" |
| 150 | erase_menu(stdscr, menu_y) |
Senthil Kumaran | c1d98d6 | 2010-11-25 14:56:44 +0000 | [diff] [blame] | 151 | |
Senthil Kumaran | 67f953c | 2010-11-26 02:20:04 +0000 | [diff] [blame] | 152 | # If color, then light the menu up :-) |
Senthil Kumaran | c1d98d6 | 2010-11-25 14:56:44 +0000 | [diff] [blame] | 153 | if curses.has_colors(): |
| 154 | stdscr.attrset(curses.color_pair(1)) |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 155 | stdscr.addstr(menu_y, 4, |
Georg Brandl | 856898b | 2010-12-30 22:11:50 +0000 | [diff] [blame] | 156 | 'Use the cursor keys to move, and space or Enter to toggle a cell.') |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 157 | stdscr.addstr(menu_y+1, 4, |
Georg Brandl | 856898b | 2010-12-30 22:11:50 +0000 | [diff] [blame] | 158 | 'E)rase the board, R)andom fill, S)tep once or C)ontinuously, Q)uit') |
Senthil Kumaran | c1d98d6 | 2010-11-25 14:56:44 +0000 | [diff] [blame] | 159 | stdscr.attrset(0) |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 160 | |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 161 | def keyloop(stdscr): |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 162 | # Clear the screen and display the menu of keys |
| 163 | stdscr.clear() |
| 164 | stdscr_y, stdscr_x = stdscr.getmaxyx() |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 165 | menu_y = (stdscr_y-3)-1 |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 166 | display_menu(stdscr, menu_y) |
| 167 | |
Senthil Kumaran | 67f953c | 2010-11-26 02:20:04 +0000 | [diff] [blame] | 168 | # If color, then initialize the color pairs |
Senthil Kumaran | c1d98d6 | 2010-11-25 14:56:44 +0000 | [diff] [blame] | 169 | if curses.has_colors(): |
| 170 | curses.init_pair(1, curses.COLOR_BLUE, 0) |
| 171 | curses.init_pair(2, curses.COLOR_CYAN, 0) |
| 172 | curses.init_pair(3, curses.COLOR_GREEN, 0) |
| 173 | curses.init_pair(4, curses.COLOR_MAGENTA, 0) |
| 174 | curses.init_pair(5, curses.COLOR_RED, 0) |
| 175 | curses.init_pair(6, curses.COLOR_YELLOW, 0) |
| 176 | curses.init_pair(7, curses.COLOR_WHITE, 0) |
| 177 | |
| 178 | # Set up the mask to listen for mouse events |
| 179 | curses.mousemask(curses.BUTTON1_CLICKED) |
| 180 | |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 181 | # Allocate a subwindow for the Life board and create the board object |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 182 | subwin = stdscr.subwin(stdscr_y-3, stdscr_x, 0, 0) |
| 183 | board = LifeBoard(subwin, char=ord('*')) |
| 184 | board.display(update_board=False) |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 185 | |
| 186 | # xpos, ypos are the cursor's position |
Guido van Rossum | 3f6dd68 | 2007-07-24 17:57:36 +0000 | [diff] [blame] | 187 | xpos, ypos = board.X//2, board.Y//2 |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 188 | |
| 189 | # Main loop: |
Georg Brandl | 856898b | 2010-12-30 22:11:50 +0000 | [diff] [blame] | 190 | while True: |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 191 | stdscr.move(1+ypos, 1+xpos) # Move the cursor |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 192 | c = stdscr.getch() # Get a keystroke |
Georg Brandl | 856898b | 2010-12-30 22:11:50 +0000 | [diff] [blame] | 193 | if 0 < c < 256: |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 194 | c = chr(c) |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 195 | if c in ' \n': |
| 196 | board.toggle(ypos, xpos) |
| 197 | elif c in 'Cc': |
| 198 | erase_menu(stdscr, menu_y) |
| 199 | stdscr.addstr(menu_y, 6, ' Hit any key to stop continuously ' |
| 200 | 'updating the screen.') |
| 201 | stdscr.refresh() |
| 202 | # Activate nodelay mode; getch() will return -1 |
| 203 | # if no keystroke is available, instead of waiting. |
| 204 | stdscr.nodelay(1) |
Georg Brandl | 856898b | 2010-12-30 22:11:50 +0000 | [diff] [blame] | 205 | while True: |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 206 | c = stdscr.getch() |
| 207 | if c != -1: |
| 208 | break |
Georg Brandl | 856898b | 2010-12-30 22:11:50 +0000 | [diff] [blame] | 209 | stdscr.addstr(0, 0, '/') |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 210 | stdscr.refresh() |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 211 | board.display() |
Georg Brandl | 856898b | 2010-12-30 22:11:50 +0000 | [diff] [blame] | 212 | stdscr.addstr(0, 0, '+') |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 213 | stdscr.refresh() |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 214 | |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 215 | stdscr.nodelay(0) # Disable nodelay mode |
| 216 | display_menu(stdscr, menu_y) |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 217 | |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 218 | elif c in 'Ee': |
| 219 | board.erase() |
| 220 | elif c in 'Qq': |
| 221 | break |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 222 | elif c in 'Rr': |
Georg Brandl | 856898b | 2010-12-30 22:11:50 +0000 | [diff] [blame] | 223 | board.make_random() |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 224 | board.display(update_board=False) |
Tim Peters | e6ddc8b | 2004-07-18 05:56:09 +0000 | [diff] [blame] | 225 | elif c in 'Ss': |
| 226 | board.display() |
| 227 | else: pass # Ignore incorrect keys |
Georg Brandl | 856898b | 2010-12-30 22:11:50 +0000 | [diff] [blame] | 228 | elif c == curses.KEY_UP and ypos > 0: ypos -= 1 |
| 229 | elif c == curses.KEY_DOWN and ypos < board.Y-1: ypos += 1 |
| 230 | elif c == curses.KEY_LEFT and xpos > 0: xpos -= 1 |
| 231 | elif c == curses.KEY_RIGHT and xpos < board.X-1: xpos += 1 |
Senthil Kumaran | c1d98d6 | 2010-11-25 14:56:44 +0000 | [diff] [blame] | 232 | elif c == curses.KEY_MOUSE: |
Georg Brandl | 856898b | 2010-12-30 22:11:50 +0000 | [diff] [blame] | 233 | mouse_id, mouse_x, mouse_y, mouse_z, button_state = curses.getmouse() |
| 234 | if (mouse_x > 0 and mouse_x < board.X+1 and |
| 235 | mouse_y > 0 and mouse_y < board.Y+1): |
Senthil Kumaran | c1d98d6 | 2010-11-25 14:56:44 +0000 | [diff] [blame] | 236 | xpos = mouse_x - 1 |
| 237 | ypos = mouse_y - 1 |
| 238 | board.toggle(ypos, xpos) |
| 239 | else: |
| 240 | # They've clicked outside the board |
| 241 | curses.flash() |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 242 | else: |
| 243 | # Ignore incorrect keys |
| 244 | pass |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 245 | |
Andrew M. Kuchling | a3b5a5f | 2000-12-13 03:50:20 +0000 | [diff] [blame] | 246 | |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 247 | def main(stdscr): |
| 248 | keyloop(stdscr) # Enter the main loop |
| 249 | |
Thomas Wouters | 73e5a5b | 2006-06-08 15:35:45 +0000 | [diff] [blame] | 250 | if __name__ == '__main__': |
| 251 | curses.wrapper(main) |