Return True if the 'A' car has reached the right edge.
(board)
| 195 | |
| 196 | |
| 197 | def hasWon(board): |
| 198 | """Return True if the 'A' car has reached the right edge.""" |
| 199 | # The puzzle is solved when the 'A' car reaches the right edge. |
| 200 | for y in range(board['height']): |
| 201 | if board[(board['width'] - 1, y)] == 'A': |
| 202 | return True |
| 203 | |
| 204 | return False |
| 205 | |
| 206 | |
| 207 | def askForPlayerMove(board): |