Skip to content
Snippets Groups Projects
Commit 36c6d9bf authored by Bariatti Francesco's avatar Bariatti Francesco
Browse files

Added nb moves to json dump

parent 986cf224
No related branches found
No related tags found
No related merge requests found
......@@ -405,6 +405,9 @@ namespace game
json["possible_moves"]["blue"] = state.nb_moves_blue;
json["current_player"] = state.current_player_red ? "Red" : "Blue";
json["nb_moves"]["red"] = state.nb_moves_red;
json["nb_moves"]["blue"] = state.nb_moves_blue;
return json;
}
......
......@@ -32,10 +32,10 @@ if __name__ == "__main__":
print("Comments: {}".format(''.join(comments)))
state = json.loads(''.join(json_data))
drawState.drawBitboard(state["bitboards"]["onefish"],state["bitboards"]["twofish"],state["bitboards"]["threefish"])
print("Red penguins")
print("Red penguins (Red score: {}, Total moves: {})".format(state["score"]["red"], state["nb_moves"]["red"]))
for i in range(4):
drawState.drawPenguin(state["penguins"]["red"][i])
print("Blue penguins")
print("Blue penguins (Blue score: {}, Total moves: {})".format(state["score"]["blue"], state["nb_moves"]["blue"]))
for i in range(4):
drawState.drawPenguin(state["penguins"]["blue"][i])
#PLAY NEXT MOVE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment