Perft

dicechess.engine.movegen.Perft
object Perft

Performance and correctness testing utility (Perft) for move generation and game-state transitions.

Recursively counts the number of leaf nodes at a given depth. If state.dicePool is empty, MoveGenerator.generateAllMoves is used (standard chess pseudo-legal moves); otherwise, MoveGenerator.generateMoves generates moves constrained by the current dice roll.

Attributes

Source
Perft.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Perft.type

Members list

Value members

Concrete methods

def countNodes(state: GameState, depth: Int): Long

Counts the number of leaf nodes at a given depth.

Counts the number of leaf nodes at a given depth.

Value parameters

depth

The remaining depth to search (leaf node counted at depth <= 0).

state

The starting game state.

Attributes

Returns

The total number of leaf nodes.

Source
Perft.scala
def divide(state: GameState, depth: Int): Map[String, Long]

Performs a divide Perft: lists each move and the number of leaf nodes it produces.

Performs a divide Perft: lists each move and the number of leaf nodes it produces.

Value parameters

depth

The search depth (must be at least 1).

state

The starting game state.

Attributes

Returns

A map from move notation to leaf node count.

Source
Perft.scala