package tiny_libs

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module MinimaxSource

Sourcetype ('state, 'move) game = {
  1. moves : 'state -> 'move list;
  2. play : 'state -> 'move -> 'state;
  3. score : 'state -> float;
  4. max_to_play : 'state -> bool;
}
Sourcetype 'move result = {
  1. value : float;
  2. best : 'move option;
  3. nodes : int;
  4. children : ('move * float) list;
}
Sourceval minimax : ('state, 'move) game -> depth:int -> 'state -> 'move result
Sourceval alphabeta : ?leaf:('state -> alpha:float -> beta:float -> float) -> ('state, 'move) game -> depth:int -> 'state -> 'move result