Rev 108 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 108 | Rev 154 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | #include "chess.h" | 1 | #include "chess.h" | 
| 2 | #include "data.h" | 2 | #include "data.h" | 
| 3 | /* last modified  | 3 | /* last modified 08/03/16 */ | 
| 4 | /* | 4 | /* | 
| 5 |  ******************************************************************************* | 5 |  ******************************************************************************* | 
| 6 |  *                                                                             * | 6 |  *                                                                             * | 
| 7 |  *   Repeat() is used to detect a draw by repetition.  The repetition list is  * | 7 |  *   Repeat() is used to detect a draw by repetition.  The repetition list is  * | 
| 8 |  *   a simple 1d array that contains the Zobrist signatures for each position  * | 8 |  *   a simple 1d array that contains the Zobrist signatures for each position  * | 
| Line 47... | Line 47... | ||
| 47 |  */ | 47 |  */ | 
| 48 | tree->rep_list[rep_index + ply] = HashKey; | 48 | tree->rep_list[rep_index + ply] = HashKey; | 
| 49 | if (Reversible(ply) < 4) | 49 | if (Reversible(ply) < 4) | 
| 50 | return 0; | 50 | return 0; | 
| 51 | if (Reversible(ply) > 99) | 51 | if (Reversible(ply) > 99) | 
| 52 | return | 52 | return 3; | 
| 53 | /* | 53 | /* | 
| 54 |  ************************************************************ | 54 |  ************************************************************ | 
| 55 |  *                                                          * | 55 |  *                                                          * | 
| 56 |  *  Now we scan the right part of the repetition list,      * | 56 |  *  Now we scan the right part of the repetition list,      * | 
| 57 |  *  which is to search backward from the entry for 2 plies  * | 57 |  *  which is to search backward from the entry for 2 plies  * | 
| Line 66... | Line 66... | ||
| 66 |  ************************************************************ | 66 |  ************************************************************ | 
| 67 |  */ | 67 |  */ | 
| 68 | count = Reversible(ply) / 2 - 1; | 68 | count = Reversible(ply) / 2 - 1; | 
| 69 | for (where = rep_index + ply - 4; count; where -= 2, count--) { | 69 | for (where = rep_index + ply - 4; count; where -= 2, count--) { | 
| 70 | if (HashKey == tree->rep_list[where]) | 70 | if (HashKey == tree->rep_list[where]) | 
| 71 | return | 71 | return 2; | 
| 72 |   } | 72 |   } | 
| 73 | return 0; | 73 | return 0; | 
| 74 | } | 74 | } | 
| 75 | 75 | ||
| 76 | /* last modified  | 76 | /* last modified 08/03/16 */ | 
| 77 | /* | 77 | /* | 
| 78 |  ******************************************************************************* | 78 |  ******************************************************************************* | 
| 79 |  *                                                                             * | 79 |  *                                                                             * | 
| 80 |  *   Repeat3x() is used to detect a real draw by repetition.  This routine is  * | 80 |  *   Repeat3x() is used to detect a real draw by repetition.  This routine is  * | 
| 81 |  *   only called from Main() and simply scans the complete list searching for  * | 81 |  *   only called from Main() and simply scans the complete list searching for  * |