| 289 | |
| 290 | |
| 291 | def getSpaceClicked(mousex, mousey): |
| 292 | # Return a tuple of two integers of the board space coordinates where |
| 293 | # the mouse was clicked. (Or returns None not in any space.) |
| 294 | for x in range(BOARDWIDTH): |
| 295 | for y in range(BOARDHEIGHT): |
| 296 | if mousex > x * SPACESIZE + XMARGIN and \ |
| 297 | mousex < (x + 1) * SPACESIZE + XMARGIN and \ |
| 298 | mousey > y * SPACESIZE + YMARGIN and \ |
| 299 | mousey < (y + 1) * SPACESIZE + YMARGIN: |
| 300 | return (x, y) |
| 301 | return None |
| 302 | |
| 303 | |
| 304 | def drawInfo(board, playerTile, computerTile, turn): |