aboutsummaryrefslogtreecommitdiff
path: root/go.py
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2022-06-29 14:32:57 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2022-06-29 14:33:03 +0200
commit080ef02ab7abc46eae1e2a550d26fdcb6c87450f (patch)
treee264c121d1672bde3525169402784ef58027a7ba /go.py
parent15faec71e4c3e972c522d6b0c81fe0b1ec7f7811 (diff)
downloadimago-080ef02ab7abc46eae1e2a550d26fdcb6c87450f.tar.gz
imago-080ef02ab7abc46eae1e2a550d26fdcb6c87450f.zip
Updated some tests.
Diffstat (limited to 'go.py')
-rwxr-xr-xgo.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/go.py b/go.py
index 96f7052..d4efc1b 100755
--- a/go.py
+++ b/go.py
@@ -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