Daniel Shawul wrote:This sounds a bit less efficient (on x86 hardware) than the functional equivilant
#define A1_OFFSET 64
#define BOARD(sq) board_[(sq) + A1_OFFSET]
i use the pointer technique. how much is this slower?
I woder how deep i have to know c in order to program chess efficiently,cause everytime i think i improved there is something else that is better. May be it is better to study assembly and get it over with.
cheers
daniel
Hey Daniel,
Learning assembler is useful, just to understand the machine you're working on--
but I wouldn't recommend it just to make your program faster. I believe algorithmic
improvements give a greater return on your time investment. According to Christoph
Theron, Chess Tiger is written 100% in C and it's fast as hades. You might be able
to make the argument that a bit of inline assembly is useful for a bitboard
based program, but otherwise the days of pure assembly programs are lone gone.
As for there always been an improvement just around the corner, isn't that
a good thing? It's what keeps the hobby fresh and interesting.
regards,
--tom