Returns a dictionary with keys 'X' and 'O', whose values.
(board)
| 168 | |
| 169 | |
| 170 | def getScoreOfBoard(board): |
| 171 | """Returns a dictionary with keys 'X' and 'O', whose values.""" |
| 172 | scores = {'X': 0, 'O': 0} # The scores start at 0. |
| 173 | # Loop over each space on the board: |
| 174 | for x in range(8): |
| 175 | for y in range(8): |
| 176 | # Increment the score if there is an X or O on this space: |
| 177 | if board[(x, y)] == 'X': |
| 178 | scores['X'] += 1 |
| 179 | if board[(x, y)] == 'O': |
| 180 | scores['O'] += 1 |
| 181 | return scores |
| 182 | |
| 183 | |
| 184 | def askForPlayerMove(board): |
no outgoing calls
no test coverage detected