game-tree-0.1.0.0: Searching game trees with alpha-beta pruning

Data.Tree.Game_tree.Negascout

Contents

Description

Negascout and other (mostly alpha-beta pruning) algorithms for game-tree search Copyright 2009 Colin Adams

This file is part of game-tree.

Game-tree is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Synopsis

Access

negamaxSource

Arguments

:: Game_tree a 
=> a

State to be evaluated

-> Int

Search this deep

-> ([a], Int)

(Principal variation, Score)

Plain negamax (= minimax with negative scores at alternate levels). No alpha-beta pruning.

alpha_beta_searchSource

Arguments

:: Game_tree a 
=> a

State to be evaluated

-> Int

Search this deep

-> ([a], Int)

(Principal variation, Score)

Normal alpha beta pruning (no window).

principal_variation_searchSource

Arguments

:: Game_tree a 
=> a

State to be evaluated

-> Int

Search this deep

-> ([a], Int)

(Principal variation, Score)

Alpha-beta pruning with null-window search around every move after a move that improves alpha has been found

negascoutSource

Arguments

:: Game_tree a 
=> a

State to be evaluated

-> Int

Search this deep

-> ([a], Int)

(Principal variation, Score)

Negascout alpha-beta pruning algorithm.

Node_value needs to be sensitive to whose turn it is to move. I.e. it must return values of the opposite sign if the other player is to move.