<div dir="ltr">Well I can attach the full .ss file here <br><br><div class="gmail_quote">On Sun, Nov 15, 2009 at 4:48 PM, Shriram Krishnamurthi <span dir="ltr"><<a href="mailto:sk@cs.brown.edu">sk@cs.brown.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I assume G forgot to reply to the list, so I'm taking the liberty of<br>
replying there.<br>
<br>
I'll point out that this code still has no data definitions, examples<br>
of data, test cases, etc.<br>
<font color="#888888"><br>
S.<br>
</font><div><div></div><div class="h5"><br>
On Sat, Nov 14, 2009 at 11:25 PM, G G <<a href="mailto:shaoron@gmail.com">shaoron@gmail.com</a>> wrote:<br>
> This is the orignal Minimax that I am trying to add Alpha-beta on<br>
><br>
><br>
> (define minimax<br>
> (lambda (b player moves max-depth heuristic-function)<br>
> (define max/min<br>
> (lambda (player)<br>
> (if (eq? player 'W) max min)))<br>
> (define minimax-move<br>
> (lambda (b player max-depth move)<br>
> (minimax/depth<br>
> (apply-move b player move)<br>
> (opponent player)<br>
> (- max-depth 1))))<br>
> (define minimax/depth<br>
> (lambda (b player max-depth)<br>
> (if (= max-depth 0)<br>
> (heuristic-function b)<br>
> (let ([moves (possible-moves b player)])<br>
> (if (null? moves)<br>
> (minimax/depth b (opponent player) (- max-depth 1))<br>
> (let ([scores<br>
> (map (lambda (move)<br>
> (minimax-move b player max-depth move))<br>
> moves)])<br>
> (apply (max/min player) scores)))))))<br>
> (let ([scores<br>
> (map (lambda (move) (minimax-move b player max-depth move))<br>
> moves)])<br>
> (let ([best (apply (max/min player) scores)])<br>
> (let loop ([moves moves] [scores scores])<br>
> (if (= (car scores) best)<br>
> (car moves)<br>
> (loop (cdr moves) (cdr scores))))))))<br>
><br>
><br>
> And I used the algorithm but i didnt know how to do these<br>
><br>
> S ← Successors(n)<br>
><br>
> best ← −∞<br>
>> for all ni ∈ S do<br>
>> v ← −αβ(ni, d − 1, −β, −max(α, best))<br>
><br>
><br>
> Thanks a lot,<br>
> G<br>
><br>
> On Sat, Nov 14, 2009 at 9:36 PM, Shriram Krishnamurthi <<a href="mailto:sk@cs.brown.edu">sk@cs.brown.edu</a>><br>
> wrote:<br>
>><br>
>> Sure, we'd be happy to help. Where are your data definitions,<br>
>> examples of data, and test cases?<br>
>><br>
>> Shriram<br>
>><br>
>> On Sat, Nov 14, 2009 at 12:00 PM, G G <<a href="mailto:shaoron@gmail.com">shaoron@gmail.com</a>> wrote:<br>
>> > I am trying to implement the alpha beta pruning but with no luck can<br>
>> > anyone<br>
>> > help me with how it works I am trying to use this Algorithm<br>
>> ><br>
>> > αβ(n, d, α, β)<br>
>> > S ← Successors(n)<br>
>> > if d ≤ 0 ∨ S ≡ ∅ then<br>
>> > return f(n)<br>
>> > best ← −∞<br>
>> > for all ni ∈ S do<br>
>> > v ← −αβ(ni, d − 1, −β, −max(α, best))<br>
>> > if v > best then<br>
>> > best ← v if best ≥ β then<br>
>> > return best<br>
>> > return best<br>
>> ><br>
>> ><br>
>> > Best regards,<br>
>> > G<br>
>> ><br>
>> > _________________________________________________<br>
>> > For list-related administrative tasks:<br>
>> > <a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br>
>> ><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br></div>