Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: High performance move generation

Author: Nicolas Carrasco

Date: 17:20:53 11/16/99

Go up one level in this thread


I rewrited my move-generator more than 3 times :( and still trying.

I am sooo surprised that I am writing a move generator with similar aspects than
you and these more advanced chess programers without reading any chess engine,
except TSCP.

This is MY work. And if you want to comment or ask something please do it!

Do you think I should restart my gen again?

Thanks
----------------------------------------------------------------------------

MACROS:

#define W_SIDE(z)	(z&WHITE) /* returns true if the value that entered was from
one white piece*/
#define B_SIDE(z)		(z>>7)	 /* Viceversa*/

#define BOARD(z)		((z&0x88)==0)	/*To check if a position

                                                  "z" is inside the board */
--------------------------------------------------------------------------------	if
(game.side == WHITE) {
		for (i=0;i<64;i++) {

			pos = boardmap[i];
			if (W_SIDE(game.board[pos])) {

/* At my complete move-generator HERE ARE  w_pawn, w_knight, w_bishop  */

if (game.board[pos] == WR) {
					w_slide(pos,+1);
					w_slide(pos,+16);
					w_slide(pos,-1);
					w_slide(pos,-16);
				}
}

void w_slide(int pos, int vector)
{
	int i;

	for(i=pos;BOARD(i) && !(W_SIDE(game.board[i]));i+=vector) {
		if(B_SIDE(game.board[i])) {
			gen_push(pos,i,1);
			break;
		}
		gen_push(pos,i,0);
	}
}
--------------------------------------------------------------------------------



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.