From ddde2a9a43daf870c26bef33f47abe45b414c3d0 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Sun, 24 Jan 2021 20:47:26 +0100 Subject: First commit! --- go.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 go.py (limited to 'go.py') diff --git a/go.py b/go.py new file mode 100755 index 0000000..548df38 --- /dev/null +++ b/go.py @@ -0,0 +1,31 @@ +#!/usr/bin/python + +"""Play Go!""" + +from imago.engine.parseHelpers import ParseCodes, parseVertex +from imago.gameLogic.gameState import GameState + +if __name__ == "__main__": + + #GAMESTATE = GameState(5) + GAMESTATE = GameState(19) + + while 1: + + GAMESTATE.getBoard().printBoard() + + move = input("Move (" + GAMESTATE.getPlayerCode() + "): ") + move = parseVertex(move, GAMESTATE.size) + + if move == ParseCodes.ERROR: + print("Invalid move syntax. Example of move: A1") + continue + + print() + + player = str(GAMESTATE.getPlayerCode()) + + moveRow = move[0] + moveCol = move[1] + + GAMESTATE.playMove(moveRow, moveCol) -- cgit v1.2.1