Returns a dictionary that represents a Four in a Row board. The keys are (columnIndex, rowIndex) tuples of two integers, and the values are one of the 'X', 'O' or '.' (empty space) strings.
()
| 52 | |
| 53 | |
| 54 | def getNewBoard(): |
| 55 | """Returns a dictionary that represents a Four in a Row board. |
| 56 | |
| 57 | The keys are (columnIndex, rowIndex) tuples of two integers, and the |
| 58 | values are one of the 'X', 'O' or '.' (empty space) strings.""" |
| 59 | board = {} |
| 60 | for columnIndex in range(BOARD_WIDTH): |
| 61 | for rowIndex in range(BOARD_HEIGHT): |
| 62 | board[(columnIndex, rowIndex)] = EMPTY_SPACE |
| 63 | return board |
| 64 | |
| 65 | |
| 66 | def displayBoard(board): |