Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 763 Bytes

game_new_initial_state.md

File metadata and controls

33 lines (26 loc) · 763 Bytes

OpenSpiel game methods: new_initial_state

Back to Core API reference

new_initial_state()

Returns a new state object representing the first state of the game. Note, in particular, this might be a chance node (where the current player is chance) in games with chance events.

Examples:

import pyspiel

game = pyspiel.load_game("hex")
state = game.new_initial_state()
print(state)

# Output:
# . . . . . . . . . . .
#  . . . . . . . . . . .
#   . . . . . . . . . . .
#    . . . . . . . . . . .
#     . . . . . . . . . . .
#      . . . . . . . . . . .
#       . . . . . . . . . . .
#        . . . . . . . . . . .
#         . . . . . . . . . . .
#          . . . . . . . . . . .
#           . . . . . . . . . . .