Adds a new 2 tile randomly to the board.
(board)
| 222 | |
| 223 | |
| 224 | def addTwoToBoard(board): |
| 225 | """Adds a new 2 tile randomly to the board.""" |
| 226 | while True: |
| 227 | randomSpace = (random.randint(0, 3), random.randint(0, 3)) |
| 228 | if board[randomSpace] == BLANK: |
| 229 | board[randomSpace] = 2 |
| 230 | return # Return after finding one non-blank tile. |
| 231 | |
| 232 | |
| 233 | def isFull(board): |