summaryrefslogtreecommitdiff
path: root/rozklady/get-tc-boards.py
diff options
context:
space:
mode:
Diffstat (limited to 'rozklady/get-tc-boards.py')
-rw-r--r--rozklady/get-tc-boards.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/rozklady/get-tc-boards.py b/rozklady/get-tc-boards.py
new file mode 100644
index 0000000..637a95c
--- /dev/null
+++ b/rozklady/get-tc-boards.py
@@ -0,0 +1,15 @@
+import json, sys
+
+for fpath in sys.argv[1:]:
+ jsfile = json.load(open(fpath))
+ print('[Board "%d"]' % (jsfile['ScoringGroups'][0]['Distribution']['_numberAsPlayed']))
+ board = []
+ for hand in ['N', 'E', 'S', 'W']:
+ board.append('%s.%s.%s.%s' % (
+ jsfile['ScoringGroups'][0]['Distribution']['_handRecord']['Hand'+hand]['Spades'],
+ jsfile['ScoringGroups'][0]['Distribution']['_handRecord']['Hand'+hand]['Hearts'],
+ jsfile['ScoringGroups'][0]['Distribution']['_handRecord']['Hand'+hand]['Diamonds'],
+ jsfile['ScoringGroups'][0]['Distribution']['_handRecord']['Hand'+hand]['Clubs']
+ ))
+ print('[Deal "N:%s"]' % (' '.join(board).replace('10', 'T')))
+ print('')