Convert user-friendly coordinates (like A1 or B5) to (x, y) coordinates (like 0,0 or 1,4).
(space)
| 322 | |
| 323 | |
| 324 | def A1ToXy(space): |
| 325 | """Convert user-friendly coordinates (like A1 or B5) to (x, y) |
| 326 | coordinates (like 0,0 or 1,4).""" |
| 327 | column = space[0] |
| 328 | row = space[1:] |
| 329 | # The ASCII value of 'A' is 65: |
| 330 | return (ord(column) - 65, int(row) - 1) |
| 331 | |
| 332 | |
| 333 | def isWinner(player, board): |