Returns the sum of all the tiles on the board data structure.
(board)
| 107 | |
| 108 | |
| 109 | def getScore(board): |
| 110 | """Returns the sum of all the tiles on the board data structure.""" |
| 111 | score = 0 |
| 112 | # Loop over every space and add the tile to the score: |
| 113 | for x in range(4): |
| 114 | for y in range(4): |
| 115 | # Only add non-blank tiles to the score: |
| 116 | if board[(x, y)] != BLANK: |
| 117 | score = score + board[(x, y)] |
| 118 | return score |
| 119 | |
| 120 | |
| 121 | def combineTilesInColumn(column): |