Sunteți pe pagina 1din 3

CHESS ENGINE DIARY THINGY INDEX 1. NEW CHESS NOTATION 2.

MOVE GENERATION MORE TO BE ADDED LATER CHAPTER 1 - CHESS NOTATION: 004 102 203 305 406 503 602 001 101 201 301 401 501 601 -NULL CHARACTERS?011 111 211 311 411 511 611 014 112 213 315 416 513 612 704 701 711 714 <= Peice IDs are wrong 3rd digit

Above is given the new implementation for representing a chess board. The code goes: First Character: Number of Spaces to the right the peice is on the row Second Character: 0 = White Peice 1 = Black Peice Third Character: 0 = Pawn 1 = Knight 2 = Bishop 3 = Rook 4 = Queen 5 = King !!!!!!!!!!!!!!!!!A CHANGE IN THE CUSTOM NOTATION OCCURS HERE!!!!!!!!!!!!!!!!! The code above this is null, but added here because it shouldnt be forgotten The starting position of a chess board will now look like this: 0004 0102 0203 0305 0406 0503 0602 0704 1001 1101 1201 1301 1401 1501 1601 1701 3000 3000 3000 3000 3000 3000 3000 3000 4000 4000 4000 4000 4000 4000 4000 4000 <= An alternate way of displaying an em pty space 5000 5000 5000 5000 5000 5000 5000 5000 6011 6111 6211 6311 6411 6511 6611 6711 7014 7112 7213 7315 7416 7513 7612 7714 A B C D E F G H WHERE: 1ST CHARACTER: The number how many sponds with the array] 2ND CHARACTER: Number of Spaces to 3RD CHARACTER: 0 = White Peice 1 = 4TH CHARACTER: 0 = Pawn 1 = Knight CHAPTER 2 - CHESS MOVE GENERATION Chess 00 01 10 11 20 21 30 31 40 41 50 51 60 61 70 71 Board 02 03 12 13 22 23 32 33 42 43 52 53 62 63 72 73 Array 04 05 14 15 24 25 34 35 44 45 54 55 64 65 74 75 Layout/Positions 06 07 [+1] 8 16 17 [-1] 16 26 27 [-3] 24 36 37 [-5] 32 46 47 [-7] 40 56 57 [-9] 48 66 67 [-11] 56 76 77 [-13] 64 spaces from the top, the rank is [which corre the right the peice is on the row Black Peice 2 = Bishop 3 = Rook 4 = Queen 5 = King

To find the corresponding place in the multiplication

table with the array positions, the rule is n = n - 2 Starting from position {3,3} 33 as shown on the table, what is the relationship between the numbers: { 33 24 15 06 Rule: n = n - 9 The number on the left is decreasing, and the number on the right is increasing. The rule is n = n - 11 } { 33 22 11 00 Rule: n = n - 11 } { 33 42 51 60 Rule: n = n + 9 } { 33 44 55 66 77 Rule: n = n + 11 } To calculate all the moves available for the bishop at point {3,3} in the array, we can assume a function would look like this [In pseudo-C++]: Func Generate_Bishop(int startingPosition) { For(int i = 0; i < 8; i++) { MovesCollection.Add(startingPosition MovesCollection.Add(startingPosition MovesCollection.Add(startingPosition MovesCollection.Add(startingPosition } Do { MovesCollection.Add(sP + 11);

+ + -

11); 11); 9); 9);

movesCollection. } continue until sP[0] || sP[1] are: Greater than 7 [ > 7 ] Less than 0 [ < 0 ] while( (sP[0] || sP[1]) (> 7 || < 0) ) } Rook Generation can therefore be worked out by simply adding or taking away one from each index of the position. Starting from {3,3} the generation would look like: { 32 31 30 [-1] 23 13 01 [-10] 34 35 36 37 [+1] 43 53 63 73 [+10] } To perform the queens generation one would simply perform both the rook and the bishop generation at the same time.

In the program itself, i should set a string or int constant with the values for the beginning

S-ar putea să vă placă și