I started a website on writing a bitboard engine, step-by-step.
Think of a bitboard version of TCSP , with Winboard support.
Having a busy full-time dayjob, and more hobbies, this is going to be a long-term project (months, maybe years).
http://www.sluijten.com/winglet/
Writing a chess program in xx steps
Moderators: hgm, Rebel, chrisw
-
- Posts: 61
- Joined: Thu Oct 22, 2009 1:50 am
- Location: Barcelona Spain
Re: Writing a chess program in xx steps
ok, good news. Very interesting idea.
I am going to follow your blog.
Bye
I am going to follow your blog.
Bye
--------------------------------------------------
Jorge García de Andrés
http://dynchess.blogspot.com.es
http://www.bitacoradelasalud.blogspot.com.es
http://www.mytechit.blogspot.com.es
Jorge García de Andrés
http://dynchess.blogspot.com.es
http://www.bitacoradelasalud.blogspot.com.es
http://www.mytechit.blogspot.com.es
-
- Posts: 216
- Joined: Thu Mar 09, 2006 9:54 pm
Re: Writing a chess program in xx steps
Thanks, looking forward to following this!sluijten wrote:I started a website on writing a bitboard engine, step-by-step.
Think of a bitboard version of TCSP , with Winboard support.
Having a busy full-time dayjob, and more hobbies, this is going to be a long-term project (months, maybe years).
http://www.sluijten.com/winglet/
-
- Posts: 855
- Joined: Sun May 23, 2010 1:32 pm
Re: Writing a chess program in xx steps
i'm just reading it and finding some good idea
-
- Posts: 44
- Joined: Wed Apr 13, 2011 12:43 pm
Re: Writing a chess program in xx steps
winglet has a board, can display it on the console window, you can set up a position manually,
or read a FEN string from a file.
Some real chess stuff is about to start: move generation.
or read a FEN string from a file.
Some real chess stuff is about to start: move generation.
Re: Writing a chess program in xx steps
Nice! It will probably guide me through the magics...
Thank you for publishing this.
Thank you for publishing this.
Re: Writing a chess program in xx steps
I think the comment:
// conversion from 64 board squares to the 8 corresponding positions in the GEN_SLIDING_ATTACKS array: MIN((8-RANKS[square]),(FILES[square]-1))
is copied from the algorithm above with the other diagonals.
MIN((8-RANKS[square]),(FILES[square]-1))
must be (i think)
MIN((RANKS[square]),(FILES[square]-1))
I think i'll try to write a more "human readable" version of this calculation
My reading of C is not so good I can understand this line of code:...
What does it mean? I had to read the comment to understand it.
// conversion from 64 board squares to the 8 corresponding positions in the GEN_SLIDING_ATTACKS array: MIN((8-RANKS[square]),(FILES[square]-1))
is copied from the algorithm above with the other diagonals.
MIN((8-RANKS[square]),(FILES[square]-1))
must be (i think)
MIN((RANKS[square]),(FILES[square]-1))
I think i'll try to write a more "human readable" version of this calculation
My reading of C is not so good I can understand this line of code:...
Code: Select all
if (GEN_SLIDING_ATTACKS[(RANKS[square]-1) < (FILES[square]-1) ? (RANKS[square]-1) : (FILES[square]-1)][state6Bit] & CHARBITSET[attackbit])
Code: Select all
// DIAGA1H8_ATTACKS attacks (BISHOPS and QUEENS):
for (square = 0; square < 64; square++)
{
for (state6Bit = 0; state6Bit < 64; state6Bit++)
{
DIAGA1H8_ATTACKS[square][state6Bit] = 0x0;
for (attackbit = 0; attackbit < 8; attackbit++) // from LSB to MSB
{
// conversion from 64 board squares to the 8 corresponding positions in the GEN_SLIDING_ATTACKS array: MIN((8-RANKS[square]),(FILES[square]-1))
if (GEN_SLIDING_ATTACKS[(RANKS[square]-1) < (FILES[square]-1) ? (RANKS[square]-1) : (FILES[square]-1)][state6Bit] & CHARBITSET[attackbit])
{
// the bit is set, so we need to update FILE_ATTACKS accordingly:
// conversion of square/attackbit to the corresponding 64 board file and rank:
diaga1h8 = FILES[square] - RANKS[square]; // from -7 to 7, longest diagonal = 0
if (diaga1h8 < 0)
{
file = attackbit + 1;
rank = file - diaga1h8;
}
else
{
rank = attackbit + 1;
file = diaga1h8 + rank;
}
if ((file > 0) && (file < 9) && (rank > 0) && (rank < 9))
{
DIAGA1H8_ATTACKS[square][state6Bit] |= BITSET[BOARDINDEX[file][rank]];
}
}
}
}
}
-
- Posts: 44
- Joined: Wed Apr 13, 2011 12:43 pm
Re: Writing a chess program in xx steps
Current functionality of winglet is:
read a FEN string from a file & setting up the board manually
bitboard move generator
evaluation function
alpha-beta pvs search
mate, draw and repetition detection (using hash keys)
iterative deepening and move ordering
Next on the list will be:
quiescence and SEE
Null move pruning
Time control and running test suites
Connecting to Winboard
read a FEN string from a file & setting up the board manually
bitboard move generator
evaluation function
alpha-beta pvs search
mate, draw and repetition detection (using hash keys)
iterative deepening and move ordering
Next on the list will be:
quiescence and SEE
Null move pruning
Time control and running test suites
Connecting to Winboard
-
- Posts: 3232
- Joined: Mon May 31, 2010 1:29 pm
- Full name: lucasart
Re: Writing a chess program in xx steps
Don't forget to put lots of assert, and to check that your perft values are correct. This part can be a real nightmare, but you cannot skip itsluijten wrote:Current functionality of winglet is:
read a FEN string from a file & setting up the board manually
bitboard move generator
evaluation function
alpha-beta pvs search
mate, draw and repetition detection (using hash keys)
iterative deepening and move ordering
Next on the list will be:
quiescence and SEE
Null move pruning
Time control and running test suites
Connecting to Winboard
Good luck!