Displays the board data structure passed to this function.
(board)
| 150 | |
| 151 | |
| 152 | def displayBoard(board): |
| 153 | """Displays the board data structure passed to this function.""" |
| 154 | |
| 155 | print(' ABCDEFGH') |
| 156 | print(' +--------+') |
| 157 | for y in range(8): |
| 158 | print('{}|'.format((y + 1)), end='') # Display the row number. |
| 159 | for x in range(8): |
| 160 | print(board[(x, y)], end='') # Display the row. |
| 161 | print('|{}'.format((y + 1))) # Display the row number. |
| 162 | print(' +--------+') |
| 163 | print(' ABCDEFGH') |
| 164 | |
| 165 | # Prints out the current score. |
| 166 | scores = getScoreOfBoard(board) |
| 167 | print('X: {} points, O: {} points'.format(scores['X'], scores['O'])) |
| 168 | |
| 169 | |
| 170 | def getScoreOfBoard(board): |
no test coverage detected