Saturday, February 9, 2008

DPS906 Code Nearly Compete

I am nearly complete my game tree assignment. I have
  1. A Move Generator
  2. Transposition Tables
  3. AlphaBeta Pruning
its a little funny to get TT and AB working together, spent 8 hours on this last night (oy what a good feeling when it worked!). I got it to work in the end, but I am VERY confused as to why

You see, there is a line of code in my program which double checks the retreived from TT score vs the current alpha/beta values. This double check exists because, the first time you run into a board layout the alpha and beta values might be very different from the second time you run into a board layout. This took me a long time to fathom... but finally I did, and I started tweaking my code.

I started coding statements like "if the value of the TT check score is greater than alpha and below beta, the board does not need rescoring" (if current.beta > tt.score > current.alpha )"

However this doesn't work. What does work is this
if( sc.score_ <= nn->d._atLeast || sc.score_ >= nn->d._atMost )

SC being the TT check score and nn->d being a structure that holds the current alpha (atLeast) and beta (atMost).

Im very perplexed... oh well it works (and is the same as the literature I've read), Im just rather confused to why. I'll send Cathy an Email.

No comments: