Return True if the entire board is one color/shape.
(board)
| 206 | |
| 207 | |
| 208 | def hasWon(board): |
| 209 | """Return True if the entire board is one color/shape.""" |
| 210 | tile = board[(0, 0)] |
| 211 | |
| 212 | for x in range(BOARD_WIDTH): |
| 213 | for y in range(BOARD_HEIGHT): |
| 214 | if board[(x, y)] != tile: |
| 215 | return False |
| 216 | return True |
| 217 | |
| 218 | |
| 219 | # If this program was run (instead of imported), run the game: |