diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2021-01-24 20:47:26 +0100 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2021-01-24 20:59:17 +0100 |
commit | ddde2a9a43daf870c26bef33f47abe45b414c3d0 (patch) | |
tree | 52576f8a97011f733360bc9904f1890867cd8bfd /go.py | |
download | imago-ddde2a9a43daf870c26bef33f47abe45b414c3d0.tar.gz imago-ddde2a9a43daf870c26bef33f47abe45b414c3d0.zip |
First commit!
Diffstat (limited to 'go.py')
-rwxr-xr-x | go.py | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -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) |