Author: Russell Reagan
Date: 16:44:10 04/09/04
Go up one level in this thread
On April 09, 2004 at 19:32:54, Brian Kostick wrote: >On April 09, 2004 at 18:04:10, Russell Reagan wrote: > >>for (row = 11; row < 12; row--) >> >>The problem is the comparison: row < 12 > > >Looks like nasty code to me. row will soon go negative and stay there for quite >some time. Maybe I'm not thinking clearly? BK row is unsigned :) So yes, it is nasty code, because it is not immediately obvious what is happening, and I'm relying on the unsigned wrap around (for example: row = 0; row--; now row == 4294967295). If I was writing this for something that I planned on using I wouldn't have written it that way. I was just hacking something together this afternoon to output a 12x12 amazons board (10x10 with padding all the way around). I am writing amazons programs to benchmark various implementations of various programming languages, so I didn't care if it was readable, only how fast it ran. Writing an amazons program is WAY easier than writing a chess program (in my experience anyway), but it should give us some idea of how a chess program would perform speed-wise under a particular implementation of a programming language, since it is similar to chess.
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.