Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 548 Bytes

state_is_terminal.md

File metadata and controls

24 lines (17 loc) · 548 Bytes

OpenSpiel state methods: is_terminal

Back to Core API reference

is_terminal()

Returns True if the state is terminal (the game has ended), False otherwise.

Examples:

import pyspiel

game = pyspiel.load_game("tic_tac_toe")
state = game.new_initial_state()
print(state.is_terminal())    # Output: False

game = pyspiel.load_game("matrix_rps")
state = game.new_initial_state()
print(state.is_terminal())    # Output: False
state.apply_actions([1, 1])
print(state.is_terminal())    # Output: True