adjust json output to arbitrary move count
This commit is contained in:
parent
b1340713bd
commit
63555cfa85
1 changed files with 2 additions and 1 deletions
3
sat.py
3
sat.py
|
@ -56,6 +56,8 @@ def toJSON(model):
|
||||||
hands = [deck[4*p:4*(p+1)] for p in range(0,5)]
|
hands = [deck[4*p:4*(p+1)] for p in range(0,5)]
|
||||||
actions = []
|
actions = []
|
||||||
for m in range(MOVES):
|
for m in range(MOVES):
|
||||||
|
if model.get_py_value(dummyturn[m]):
|
||||||
|
break
|
||||||
if model.get_py_value(discard_any[m]):
|
if model.get_py_value(discard_any[m]):
|
||||||
discarded = next(i for i in range(0,50) if model.get_py_value(discard[m][i]))
|
discarded = next(i for i in range(0,50) if model.get_py_value(discard[m][i]))
|
||||||
icard = hands[m % 5].index(deck[discarded])
|
icard = hands[m % 5].index(deck[discarded])
|
||||||
|
@ -90,7 +92,6 @@ def toJSON(model):
|
||||||
"first_player": 0,
|
"first_player": 0,
|
||||||
"options": {
|
"options": {
|
||||||
"variant": "No Variant",
|
"variant": "No Variant",
|
||||||
"allOrNothing": True
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print(json.dumps(game))
|
print(json.dumps(game))
|
||||||
|
|
Loading…
Reference in a new issue