Interpreting Alpha-Beta pseudo-code

Discussion of chess software programming and technical issues.

Moderator: Ras

Fguy64
Posts: 814
Joined: Sat May 09, 2009 4:51 pm
Location: Toronto

Re: Interpreting Alpha-Beta pseudo-code

Post by Fguy64 »

yeah you are right. I missed the boat completely on this one, and I can't even blame it on a misunderstanding of beta cutoff. More like a complete and utter brain cramp with regards to the proper functioning of a return statement. Programming for Dummies. And to think I argued the same mistake over and over again.

if (val >= beta) return beta;

if a condition is met that causes a return from a method, then of course the rest of the method is cut off. It matters not that one is in a loop or a plain sequence of statements.

I guess I did miss the point on beta also, The engine wasn't missing out on a beneficial promo, a correctly played game would never have progressed to that point anyway. Unfortunately that doesn't excuse the brain cramp.

heavy sigh :oops:
User avatar
xsadar
Posts: 147
Joined: Wed Jun 06, 2007 10:01 am
Location: United States
Full name: Mike Leany

Re: Interpreting Alpha-Beta pseudo-code

Post by xsadar »

Fguy64 wrote: . . .
Unfortunately that doesn't excuse the brain cramp.

heavy sigh :oops:
No worries. We all make silly mistakes sometimes. I've made some myself the last few days.