diff options
Diffstat (limited to 'go.py')
-rwxr-xr-x | go.py | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -2,7 +2,7 @@ """Play Go!""" -from imago.engine.parseHelpers import ParseCodes, parseVertex +from imago.engine.parseHelpers import parseVertex from imago.gameLogic.gameState import GameState if __name__ == "__main__": @@ -10,14 +10,15 @@ if __name__ == "__main__": GAMESTATE = GameState(5) #GAMESTATE = GameState(19) - while 1: + while True: GAMESTATE.getBoard().printBoard() move = input("Move (" + GAMESTATE.getPlayerCode() + "): ") - move = parseVertex(move, GAMESTATE.size) - if move == ParseCodes.ERROR: + try: + move = parseVertex(move, GAMESTATE.size) + except Exception as err: print("Invalid move syntax. Example of move: A1") continue |