Skip to content

Commit

Permalink
Print states starting on their own line.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 273312779
Change-Id: I909df10509b31752958996e8f52fd5c286355497
  • Loading branch information
DeepMind Technologies Ltd authored and open_spiel@google.com committed Oct 7, 2019
1 parent 734daf1 commit 98ed431
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions open_spiel/python/examples/mcts.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def _get_action(state, action_str):
def _play_game(game, initial_actions):
"""Plays one game."""
state = game.new_initial_state()
_opt_print("Initial state: ", str(state))
_opt_print("Initial state:\n{}".format(state))

bots = [
_init_bot(FLAGS.player1, game, 0),
Expand All @@ -98,7 +98,7 @@ def _play_game(game, initial_actions):
history.append(action_str)
state.apply_action(action)
_opt_print("Forced action", action_str)
_opt_print("Next state: ", str(state))
_opt_print("Next state:\n{}".format(state))

while not state.is_terminal():
# The state can be three different types: chance node,
Expand Down Expand Up @@ -129,7 +129,7 @@ def _play_game(game, initial_actions):
history.append(action_str)
state.apply_action(action)

_opt_print("Next state: ", str(state))
_opt_print("Next state:\n{}".format(state))

# Game is now done. Print return for each player
returns = state.returns()
Expand Down

0 comments on commit 98ed431

Please sign in to comment.