aboutsummaryrefslogtreecommitdiff
path: root/testSGF.py
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2022-07-01 16:10:15 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2022-07-01 16:10:15 +0200
commitb08408d23186205e71dfc68634021e3236bfb45c (patch)
tree55e5679b6964902dadab1d5737546cfd4f0f2f0a /testSGF.py
parentddde2a9a43daf870c26bef33f47abe45b414c3d0 (diff)
downloadimago-b08408d23186205e71dfc68634021e3236bfb45c.tar.gz
imago-b08408d23186205e71dfc68634021e3236bfb45c.zip
First version.
Diffstat (limited to 'testSGF.py')
-rwxr-xr-xtestSGF.py20
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()