[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

Re: Alpha- Beta pruning.. Mancala

rmncfrv

12/16/2015 10:57:00 PM

On Sunday, 21 November 1993 18:59:49 UTC, Ashim Chhabra wrote:
> I am having trouble interpreting the alpha-beta search technique into actual
> psedocode.. I'm thinking about using this technique for my Lisp project where
> I have to make the Mancala game intelligent.
>
> Does anyone out there have any ideas.. The algorithm in my text is not in much
> detail and is hard to understand.. (Matt Ginsberg-Essentials of AI)
>
> Please reply directly to me.. Any help would be appreciated..
>
> thanks

alpha-beta(player,board,alpha,beta)
if(game over in current board position)
return winner

children = all legal moves for player from this board
if(max's turn)
for each child
score = alpha-beta(other player,child,alpha,beta)
if score > alpha then alpha = score (we have found a better best move)
if alpha >= beta then return alpha (cut off)
return alpha (this is our best move)
else (min's turn)
for each child
score = alpha-beta(other player,child,alpha,beta)
if score < beta then beta = score (opponent has found a better worse move)
if alpha >= beta then return beta (cut off)
return beta (this is the opponent's best move)