Skip to content

Latest commit

 

History

History
81 lines (40 loc) · 1.51 KB

negamax-ref.rst

File metadata and controls

81 lines (40 loc) · 1.51 KB

negamax Reference

The following are the references for negamax.

Types

NegamaxPlayer

NegamaxPlayer* = ref object of Player
  depth*: int

source line: 216

this is the AI player to be used with the turn_based_game library

Procs, Methods, Iterators

get_move

method get_move*(self: NegamaxPlayer, game: Game): string =

source line: 221

Get the chosen move from the algorithm in the context of a turn_based_game library Game.

negamax

proc negamax*(game: var Game, depth: int): string =

source line: 176

This is the main negamax algorithm.

depth determines the number of plies for the algorithm to look ahead.

returns a string move from the game's list of available possible moves. If there are not moves possible, it will return an empty string.

Table Of Contents

  1. Introduction to negamax

  2. Appendices

    1. negamax Reference