summaryrefslogtreecommitdiff
path: root/games/exchess/patches/patch-aa
diff options
context:
space:
mode:
Diffstat (limited to 'games/exchess/patches/patch-aa')
-rw-r--r--games/exchess/patches/patch-aa49
1 files changed, 45 insertions, 4 deletions
diff --git a/games/exchess/patches/patch-aa b/games/exchess/patches/patch-aa
index 78321e9102d..4262bf8555e 100644
--- a/games/exchess/patches/patch-aa
+++ b/games/exchess/patches/patch-aa
@@ -1,4 +1,4 @@
-$NetBSD: patch-aa,v 1.2 2011/11/25 21:52:33 joerg Exp $
+$NetBSD: patch-aa,v 1.3 2013/04/30 22:20:58 joerg Exp $
--- book.cpp.orig 2000-04-30 09:56:26.000000000 +0000
+++ book.cpp
@@ -20,16 +20,23 @@ $NetBSD: patch-aa,v 1.2 2011/11/25 21:52:33 joerg Exp $
/* variables for book learning */
book_rec learn_book[100]; // book learning array
int learn_count = 0; // number of book moves played
-@@ -52,7 +54,7 @@ void build_book(position ipos)
+@@ -51,8 +53,8 @@ void build_book(position ipos)
+ char instring[100], line[100]; // strings from input files
char outbook[100];
position temp_pos; // temporary position
- move bmove; // book move under consideration
+- move bmove; // book move under consideration
- unsigned __int64 pcode; // hash code for position
++ my_move bmove; // book move under consideration
+ u_int64_t pcode; // hash code for position
int i = -1, j = 0, k = 0, p; // loop variables
int count = 0, thresh, LINE_DEPTH; // control variables
-@@ -245,7 +247,7 @@ int find_record(position p, move m, int
+@@ -241,11 +243,11 @@ book_rec book_record; // working reco
+ position temporary_pos; // working position
+
+ /* Function to find a position in the book */
+-int find_record(position p, move m, int file_size)
++int find_record(position p, my_move m, int file_size)
{
file_pos = 0;
int jump = int(file_size/2);
@@ -38,3 +45,37 @@ $NetBSD: patch-aa,v 1.2 2011/11/25 21:52:33 joerg Exp $
temporary_pos = p;
if(!exec_move(&temporary_pos, m, 1)) return 0;
+@@ -299,13 +301,13 @@ int find_record(position p, move m, int
+ // position is in the book. If so, the move in question
+ // becomes a candidate move. Information is stored to
+ // facilitate easy learning during the game.
+-move opening_book(h_code hash_code, position p)
++my_move opening_book(h_code hash_code, position p)
+ {
+ int file_size, mflag = 0, j;
+ int candidates = 0, total_score = 0;
+ int logger = 0, poster = 0;
+ move_list list;
+- move nomove; nomove.t = 0;
++ my_move nomove; nomove.t = 0;
+ char book_file[100]; // file name for the book
+
+ // generate legal moves
+@@ -398,7 +400,7 @@ int edit_book(h_code hash_code, position
+ int file_size, mflag = 0, j, outflag = 0;
+ int search_time = 0, total_score = 0;
+ move_list list;
+- move nomove; nomove.t = 0;
++ my_move nomove; nomove.t = 0;
+ char resp[2];
+ char book_file[100]; // file name for the book
+
+@@ -462,7 +464,7 @@ int edit_book(h_code hash_code, position
+ if(outflag == 1) cout << "\n";
+
+ /* Edit mode for individual moves */
+- move edit_move;
++ my_move edit_move;
+ while(1) {
+ cout << "\nEnter a move to be edited/investigated (0 = quit): ";
+ cin >> mstring; if(mstring[0] == '0') break;