Returns a list of [x, y] lists of valid moves for the given player on the given board.
(board, tile)
| 73 | |
| 74 | |
| 75 | def getValidMoves(board, tile): |
| 76 | """Returns a list of [x, y] lists of valid moves for the given |
| 77 | player on the given board.""" |
| 78 | validMoves = [] |
| 79 | |
| 80 | for x in range(8): |
| 81 | for y in range(8): |
| 82 | if isValidMove(board, tile, x, y) != False: |
| 83 | validMoves.append([x, y]) |
| 84 | return validMoves |
| 85 | |
| 86 | |
| 87 | def isValidMove(board, tile, xstart, ystart): |
no test coverage detected