Attributes
- Companion
- trait
- Graph
-
- Supertypes
- Self type
-
TicTacToeState$.type
Members list
Type members
Inherited classlikes
Attributes
- Inherited from:
- Ordering
- Supertypes
-
class Objecttrait Matchableclass Any
Value members
Inherited methods
Method to determine the ordering of two States. It is based on the heuristic.
Method to determine the ordering of two States. It is based on the heuristic.
Value parameters
- s1
-
first S.
- s2
-
second S.
Attributes
- Returns
-
<0 if s1 < s2, >0 if s1 > s2, else 0.
- Inherited from:
- State
Method to construct an S from a proto-state:
Method to construct an S from a proto-state:
Value parameters
- proto
-
a (Board, TicTacToe) tuple.
Attributes
- Returns
-
a TicTacToe.
- Inherited from:
- TicTacToeState$
Attributes
- Definition Classes
-
Ordering -> PartialOrdering -> Equiv
- Inherited from:
- Ordering
Concrete method to get the possible states to follow the given state s. The resulting sequence is in no particular order.
Concrete method to get the possible states to follow the given state s. The resulting sequence is in no particular order.
Value parameters
- s
-
an S.
Attributes
- Returns
-
a sequence of S instances which are the possible states to follow s.
- Inherited from:
- State
Attributes
- Definition Classes
-
Ordering -> PartialOrdering
- Inherited from:
- Ordering
Attributes
- Definition Classes
-
Ordering -> PartialOrdering
- Inherited from:
- Ordering
How close are we to winning?
How close are we to winning?
Value parameters
- s
-
a state.
Attributes
- Returns
-
the number of our aligned cells - their aligned cells.
- Inherited from:
- TicTacToeState$
Returns true if it is the first player's turn to move from state s.
Returns true if it is the first player's turn to move from state s.
To be completely unambiguous: the first player is the one who makes the very first move of the game. isFirstPlayerToMove(s) returns true when it is that player's turn again — e.g., for a two-player game, when an even number of moves have been made (sequence 0, 2, 4, ...).
It returns false when it is the second (or any subsequent) player's turn — i.e., when an odd number of moves have been made (sequence 1, 3, 5, ...).
Example (TicTacToe): empty board (sequence=0) → true (X moves first) after X plays (sequence=1) → false (O moves next) after O plays (sequence=2) → true (X moves next)
For games with more than two players, override this method as needed.
Value parameters
- s
-
the current state.
Attributes
- Returns
-
true if the first player is to move, false otherwise.
- Inherited from:
- State
Have we reached a result? And, if so, who won?
Have we reached a result? And, if so, who won?
Value parameters
- s
-
a (current) state.
Attributes
- Returns
-
an
Option[Boolean]: ifNonethen this state is not a goal state. IfSome(b)then: if b is true, we got a definite result, and the winner is determined by examiningsin more detail. If b is false, we got a partial result, and we should continue to seek a more definite result. - Inherited from:
- TicTacToeState$
Attributes
- Inherited from:
- Ordering
In this game, all states are valid.
In this game, all states are valid.
Value parameters
- s
-
a state.
Attributes
- Returns
-
true.
- Inherited from:
- TicTacToeState$
Method to determine if s is a winning state. NOTE: it makes no sense to invoke isWin unless the result of isGoal is Some(true).
Method to determine if s is a winning state. NOTE: it makes no sense to invoke isWin unless the result of isGoal is Some(true).
Value parameters
- s
-
an S
Attributes
- Returns
-
true if s is a win, else false.
- Inherited from:
- TicTacToeState$
Attributes
- Definition Classes
-
Ordering -> PartialOrdering
- Inherited from:
- Ordering
Attributes
- Definition Classes
-
Ordering -> PartialOrdering
- Inherited from:
- Ordering
Return all of the possible transitions from the given state.
Return all of the possible transitions from the given state.
CONSIDER refactoring so that we do not discard the state when constructing a Move.
Value parameters
- s
-
a state.
Attributes
- Returns
-
a sequence of Transition[S]
- Inherited from:
- TicTacToeState$
Attributes
- Inherited from:
- Ordering
Method to render a State as a String.
Method to render a State as a String.
Value parameters
- s
-
the State to render.
Attributes
- Returns
-
a String representation of s.
- Inherited from:
- TicTacToeState$
Attributes
- Definition Classes
-
Ordering -> PartialOrdering
- Inherited from:
- Ordering
a significant sequence value that distinguishes this state from others and which can be derived from a P.
a significant sequence value that distinguishes this state from others and which can be derived from a P.
Value parameters
- s
-
parameter from which we may derive the sequence.
Attributes
- Inherited from:
- TicTacToeState$
Attributes
- Inherited from:
- Comparator
Attributes
- Inherited from:
- Comparator
Attributes
- Inherited from:
- Comparator
Attributes
- Inherited from:
- Comparator
Attributes
- Inherited from:
- Comparator
Attributes
- Inherited from:
- Comparator
Attributes
- Inherited from:
- Ordering
Implicits
Inherited implicits
Attributes
- Inherited from:
- Ordering