* doc/org/tut40.org: Clarify, as suggested by a CAV'22 reviewer.
This commit is contained in:
parent
d1f49c721a
commit
58f39ec287
1 changed files with 6 additions and 4 deletions
|
|
@ -144,9 +144,11 @@ states.
|
||||||
|
|
||||||
We now look at how to create such a game in Python.
|
We now look at how to create such a game in Python.
|
||||||
|
|
||||||
Essentially, a game in Spot is just an automaton equiped with a
|
Essentially, a game in Spot is just an automaton equiped with a [[file:concepts.org::#named-properties][named
|
||||||
special property to indicate the owner of each states. So it can be
|
property "state-player"]] that hold a Boolean vector indicating the
|
||||||
created using the usual interface:
|
owner of each state. The game can be created using the usual
|
||||||
|
automaton interface, and the owners are set by calling
|
||||||
|
=game.set_state_players()= with a vector of Boolean at the very end.
|
||||||
|
|
||||||
#+NAME: build_game
|
#+NAME: build_game
|
||||||
#+BEGIN_SRC python :exports code
|
#+BEGIN_SRC python :exports code
|
||||||
|
|
@ -173,7 +175,7 @@ created using the usual interface:
|
||||||
todo = []
|
todo = []
|
||||||
|
|
||||||
# Create the state (i, j) for a player if it does not exist yet and
|
# Create the state (i, j) for a player if it does not exist yet and
|
||||||
# returns the state's number in the game.
|
# return the state's number in the game.
|
||||||
def get_game_state(player, i, j):
|
def get_game_state(player, i, j):
|
||||||
orig_state = s_orig_states if player else d_orig_states
|
orig_state = s_orig_states if player else d_orig_states
|
||||||
if (i, j) in orig_state:
|
if (i, j) in orig_state:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue