Author: Nicolas Carrasco
Date: 17:31:19 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]; // In order to skip unused elements 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); } else if(game.board[pos == WQ) { /*..................*/ } else { /* KING ( I think it will be a good idea to put here the queen and over this else the king because of my obious stats but when we are at endgames with more than one QUEEN it will a bit slower .................. */ } } } 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.