diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2022-07-01 16:10:15 +0200 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2022-07-01 16:10:15 +0200 |
commit | b08408d23186205e71dfc68634021e3236bfb45c (patch) | |
tree | 55e5679b6964902dadab1d5737546cfd4f0f2f0a /testSGF.py | |
parent | ddde2a9a43daf870c26bef33f47abe45b414c3d0 (diff) | |
download | imago-b08408d23186205e71dfc68634021e3236bfb45c.tar.gz imago-b08408d23186205e71dfc68634021e3236bfb45c.zip |
First version.
Diffstat (limited to 'testSGF.py')
-rwxr-xr-x | testSGF.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/testSGF.py b/testSGF.py new file mode 100755 index 0000000..08a1bee --- /dev/null +++ b/testSGF.py @@ -0,0 +1,20 @@ +#!/usr/bin/python + +"""Gets a game from an SGF file.""" + +import sys + +from imago.sgfParser.sgf import loadGameTree + +def main(): + filename = sys.argv[1] + move = loadGameTree(filename) + while move is not None: + move.printBoard() + if len(move.nextMoves) > 0: + move = move.nextMoves[0] + else: + move = None + +if __name__ == '__main__': + main() |