User Tools

Site Tools


chess:programming:alpha-beta_pruning:transposition_table_enhanced_alpha-beta

This is an old revision of the document!


Chess - Programming - Alpha-Beta Pruning - Transposition table enhanced Alpha-Beta

function Alpha-Beta(n, alpha, beta)
  // Check if position is in TT and has been searched to sufficient depth.
  if retrieve(n) = found then
    if n.ƒ+ or n.ƒ+ = n.ƒ then return n.ƒ+;
if n.ƒ then return n.ƒ ;
/* Reached the maximum search depth */
if n = leaf then
n.ƒ := n.ƒ+ := g := eval(n);
else
g := ; a := ;
c := firstchild(n);
/* Search until a cutoff occurs or all children have been considered */
while g < and c = do
g := max(g, Alpha-Beta(c, , a));
a := max(a, g);
c := nextbrother(c);
/* Save in transposition table */
if g then n.ƒ+ := g;
if < g < then n.ƒ+ := n.ƒ := g;
if g then n.ƒ := g;
store(n);
return g;
chess/programming/alpha-beta_pruning/transposition_table_enhanced_alpha-beta.1636584288.txt.gz · Last modified: 2021/11/10 22:44 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki