Given a state aState and a player aPlayer, returns the list of all possible moves for this player from this state.
aState
aPlayer
a state of the game
a player of the game, "o" or "x"
"o"
"x"
stateNexts(['x', 'o', 'x', ' ', ' ', ' ', 'x', 'o', 'x'], 'x');// -> [ [ 'x', 'o', 'x', 'x', ' ', ' ', 'x', 'o', 'x' ],// [ 'x', 'o', 'x', ' ', 'x', ' ', 'x', 'o', 'x' ],// [ 'x', 'o', 'x', ' ', ' ', 'x', 'x', 'o', 'x' ] ] Copy
stateNexts(['x', 'o', 'x', ' ', ' ', ' ', 'x', 'o', 'x'], 'x');// -> [ [ 'x', 'o', 'x', 'x', ' ', ' ', 'x', 'o', 'x' ],// [ 'x', 'o', 'x', ' ', 'x', ' ', 'x', 'o', 'x' ],// [ 'x', 'o', 'x', ' ', ' ', 'x', 'x', 'o', 'x' ] ]
Given a state
aStateand a playeraPlayer, returns the list of all possible moves for this player from this state.