Author: Russell Reagan
Date: 09:04:56 03/05/04
Go up one level in this thread
On March 05, 2004 at 03:39:02, José Carlos wrote: > Attacked = ((UINT64)File[n] << 16) & WhiteAll >or instead of that: > u64Attacked = ((UINT64)u8File[n] << 16) & u64WhiteAll > > When next year I come back to this line to make some change, I hope to find >second verion rather than first. What if you move to a new 64-bit machine with lots of cache where accessing individual bytes is significantly slower than accessing larger data (16-bit, 32-bit, or 64-bit)? Now you've got a lot of changes to make. With just about any modern IDE you can find out the type by placing the mouse cursor over the variable. If you're using vi and gcc, well, you've got me there :) In your code I would still prefer to hide the bit twiddling to make it more readable and abstract the HN away into the details. Maybe something like: Attacked = KnightAttacks(Square); If you want to use HN within the KnightAttacks function, that would seem more reasonable to me. Instead of worrying about what type everything is all over your program, you just have to worry about what type the things are within small little functions like that. They can be inlined of course, and with C++ they will be typesafe so your compiler will yell at you if your types get messed up. But I guess this is still a personal preference. I like my code to be more abstracted because I like to fiddle with it and change lots of things to see what works better.
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.