TicTacToe

com.phasmidsoftware.gambit.examples.tictactoe.TicTacToe
See theTicTacToe companion class
object TicTacToe

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
TicTacToe.type

Members list

Type members

Classlikes

Attributes

Companion
trait
Supertypes
trait Ordering[TicTacToe]
trait PartialOrdering[TicTacToe]
trait Equiv[TicTacToe]
trait Serializable
trait Comparator[TicTacToe]
class Object
trait Matchable
class Any
Show all
Self type

Trait that extends the type class State with a concrete underlying type of TicTacToe.

Trait that extends the type class State with a concrete underlying type of TicTacToe.

Attributes

Companion
object
Supertypes
trait Ordering[TicTacToe]
trait PartialOrdering[TicTacToe]
trait Equiv[TicTacToe]
trait Serializable
trait Comparator[TicTacToe]
class Object
trait Matchable
class Any
Show all
Known subtypes
object loggableTicTacToe extends Loggable[TicTacToe]

Attributes

Supertypes
trait Loggable[TicTacToe]
class Object
trait Matchable
class Any
Self type

Types

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def apply(board: Board): TicTacToe

Method to construct a starting position TicTacToe.

Method to construct a starting position TicTacToe.

Value parameters

board

the Board that defines a TicTacToe.

Attributes

Returns

a TicTacToe with the given board, no predecessor, and an empty board.

def apply(proto: (Board, TicTacToe)): TicTacToe

Method to construct a starting position TicTacToe.

Method to construct a starting position TicTacToe.

Value parameters

proto

(Board, TicTacToe).

Attributes

Returns

a TicTacToe with the given board and no predecessor.

def apply(): TicTacToe

Method to construct a starting position TicTacToe.

Method to construct a starting position TicTacToe.

Attributes

Returns

a TicTacToe with all empty cells, no predecessor and an empty Board.

def apply(board: Board, mask: Int): TicTacToe

Apply method mostly for testing.

Apply method mostly for testing.

Value parameters

board

the current Board.

mask

a mask that defines the bits to be eliminated from board to yield the previous Board.

Attributes

Returns

a TicTacToe.

def from(sequence: Row, x: Row, maybePriorBoard: Option[Board]): TicTacToe

Method to construct a TicTacToe with prior from a particular bit pattern and a mask.

Method to construct a TicTacToe with prior from a particular bit pattern and a mask.

Value parameters

maybePriorBoard

an optional bit pattern to yield the prior state.

x

the bit pattern.

Attributes

Returns

a TicTacToe with all empty cells.

def parse(s: String, maybeMask: Option[Int] = ...): Try[TicTacToe]

Method to parse a String of Xs and 0s into a TicTacToe, wrapped in Try.

Method to parse a String of Xs and 0s into a TicTacToe, wrapped in Try.

CONSIDER making this private.

Value parameters

s

the String to parse (which may include \n characters for better visualization).

Attributes

Returns

a Try of TicTacToe.

def parseString(s: String, maybeMask: Option[Int]): TicTacToe

Method to parse a pattern for a starting position. NOTE: do not use for later positions.

Method to parse a pattern for a starting position. NOTE: do not use for later positions.

Value parameters

s

a String made up of 9 case-independent characters, each of which must be an X, 0, O, ., or space. CONSIDER allowing newlines.

Attributes

Returns

a TicTacToe.

Concrete fields

val size: Int