Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Curious about mailbox move generation--namely, what is it?

Author: William H Rogers

Date: 11:43:58 02/06/04

Go up one level in this thread


On February 06, 2004 at 13:36:57, Kim Roper Jensen wrote:

>>>int board[119] = {
>>>      0, 0, 0, 0, 0, 0, 0, 0, 0, 0
>>>      0, 0, 0, 0, 0, 0, 0, 0, 0, 0
>>>    8 0, 1, 1, 1, 1, 1, 1, 1, 1, 0
>>>    7 0, 1, 1, 1, 1, 1, 1, 1, 1, 0
>>>    6 0, 1, 1, 1, 1, 1, 1, 1, 1, 0
>>>    5 0, 1, 1, 1, 1, 1, 1, 1, 1, 0
>>>    4 0, 1, 1, 1, 1, 1, 1, 1, 1, 0
>>>    3 0, 1, 1, 1, 1, 1, 1, 1, 1, 0
>>>    2 0, 1, 1, 1, 1, 1, 1, 1, 1, 0
>>>    1 0, 1, 1, 1, 1, 1, 1, 1, 1, 0
>>>      0, 0, 0, 0, 0, 0, 0, 0, 0, 0
>>>      0, 0, 0, 0, 0, 0, 0, 0, 0, 0
         x  a  b  c  d  e  f  g  h  y

>generating knight moves in the corner makes the zero's needed or else there
>would be some wraparound ...
>
>/kim
That was a common misconception used in the begining by many chess programmers.
First thing to remember is that although we make the chess board look like a
three dementional picture in reality in the program it is just one long string
of numbers. In other words it should be a chain of numbers that is 120
characters long. Looking at the bottome of your diagram, reading from left to
right, the right hand zero is directly next to the first left hand zero on the
second line and so forth. Take the following example: We have a knight on H1, if
the knight tries to move to the left first he hits one zero on row one, next he
would hit one zero on row 2, just before the square A2. The only double set of
zeros needed is at the begining and at the end for when the knight tries to move
forward or backwards.
I hope that this explains why we do not need the extra zeros on each side of the
board. If you have any more questions, I'll be glad to try to explain as well as
I can.
Bill




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.