head 1.7; access; symbols pkgsrc-2014Q2:1.6.0.4 pkgsrc-2014Q2-base:1.6 pkgsrc-2014Q1:1.6.0.2 pkgsrc-2014Q1-base:1.6 pkgsrc-2013Q4:1.5.0.6 pkgsrc-2013Q4-base:1.5 pkgsrc-2013Q3:1.5.0.4 pkgsrc-2013Q3-base:1.5 pkgsrc-2013Q2:1.5.0.2 pkgsrc-2013Q2-base:1.5 pkgsrc-2013Q1:1.4.0.10 pkgsrc-2013Q1-base:1.4 pkgsrc-2012Q4:1.4.0.8 pkgsrc-2012Q4-base:1.4 pkgsrc-2012Q3:1.4.0.6 pkgsrc-2012Q3-base:1.4 pkgsrc-2012Q2:1.4.0.4 pkgsrc-2012Q2-base:1.4 pkgsrc-2012Q1:1.4.0.2 pkgsrc-2012Q1-base:1.4 pkgsrc-2011Q4:1.3.0.2 pkgsrc-2011Q4-base:1.3 pkgsrc-2011Q3:1.2.0.66 pkgsrc-2011Q3-base:1.2 pkgsrc-2011Q2:1.2.0.64 pkgsrc-2011Q2-base:1.2 pkgsrc-2011Q1:1.2.0.62 pkgsrc-2011Q1-base:1.2 pkgsrc-2010Q4:1.2.0.60 pkgsrc-2010Q4-base:1.2 pkgsrc-2010Q3:1.2.0.58 pkgsrc-2010Q3-base:1.2 pkgsrc-2010Q2:1.2.0.56 pkgsrc-2010Q2-base:1.2 pkgsrc-2010Q1:1.2.0.54 pkgsrc-2010Q1-base:1.2 pkgsrc-2009Q4:1.2.0.52 pkgsrc-2009Q4-base:1.2 pkgsrc-2009Q3:1.2.0.50 pkgsrc-2009Q3-base:1.2 pkgsrc-2009Q2:1.2.0.48 pkgsrc-2009Q2-base:1.2 pkgsrc-2009Q1:1.2.0.46 pkgsrc-2009Q1-base:1.2 pkgsrc-2008Q4:1.2.0.44 pkgsrc-2008Q4-base:1.2 pkgsrc-2008Q3:1.2.0.42 pkgsrc-2008Q3-base:1.2 cube-native-xorg:1.2.0.40 cube-native-xorg-base:1.2 pkgsrc-2008Q2:1.2.0.38 pkgsrc-2008Q2-base:1.2 cwrapper:1.2.0.36 pkgsrc-2008Q1:1.2.0.34 pkgsrc-2008Q1-base:1.2 pkgsrc-2007Q4:1.2.0.32 pkgsrc-2007Q4-base:1.2 pkgsrc-2007Q3:1.2.0.30 pkgsrc-2007Q3-base:1.2 pkgsrc-2007Q2:1.2.0.28 pkgsrc-2007Q2-base:1.2 pkgsrc-2007Q1:1.2.0.26 pkgsrc-2007Q1-base:1.2 pkgsrc-2006Q4:1.2.0.24 pkgsrc-2006Q4-base:1.2 pkgsrc-2006Q3:1.2.0.22 pkgsrc-2006Q3-base:1.2 pkgsrc-2006Q2:1.2.0.20 pkgsrc-2006Q2-base:1.2 pkgsrc-2006Q1:1.2.0.18 pkgsrc-2006Q1-base:1.2 pkgsrc-2005Q4:1.2.0.16 pkgsrc-2005Q4-base:1.2 pkgsrc-2005Q3:1.2.0.14 pkgsrc-2005Q3-base:1.2 pkgsrc-2005Q2:1.2.0.12 pkgsrc-2005Q2-base:1.2 pkgsrc-2005Q1:1.2.0.10 pkgsrc-2005Q1-base:1.2 pkgsrc-2004Q4:1.2.0.8 pkgsrc-2004Q4-base:1.2 pkgsrc-2004Q3:1.2.0.6 pkgsrc-2004Q3-base:1.2 pkgsrc-2004Q2:1.2.0.4 pkgsrc-2004Q2-base:1.2 pkgsrc-2004Q1:1.2.0.2 pkgsrc-2004Q1-base:1.2 pkgsrc-2003Q4:1.1.1.1.0.10 pkgsrc-2003Q4-base:1.1.1.1 netbsd-1-6-1:1.1.1.1.0.6 netbsd-1-6-1-base:1.1.1.1 netbsd-1-6:1.1.1.1.0.8 netbsd-1-6-RELEASE-base:1.1.1.1 pkgviews:1.1.1.1.0.4 pkgviews-base:1.1.1.1 buildlink2:1.1.1.1.0.2 buildlink2-base:1.1.1.1 netbsd-1-5-PATCH003:1.1.1.1 netbsd-1-5-PATCH001:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.7 date 2014.09.11.16.59.16; author jperkin; state dead; branches; next 1.6; commitid b7OUQ9vL3mT5TWPx; 1.6 date 2014.02.09.16.50.45; author wiedi; state Exp; branches; next 1.5; commitid jRY2a7BWC0pYKrox; 1.5 date 2013.04.30.22.20.58; author joerg; state Exp; branches; next 1.4; 1.4 date 2012.01.20.17.07.35; author joerg; state Exp; branches; next 1.3; 1.3 date 2011.11.25.21.52.33; author joerg; state Exp; branches; next 1.2; 1.2 date 2004.02.14.04.31.56; author kristerw; state Exp; branches; next 1.1; 1.1 date 2000.10.25.08.40.00; author jlam; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2000.10.25.08.40.00; author jlam; state Exp; branches; next ; desc @@ 1.7 log @Update games/exchess to v7.31beta, this package's first update in 14 years. The primary motivator for the upgrade is to improve the book generation time, which is now several times faster (builds were failing with CPU ulimit of 1 hour on 3GHz Xeon E5's with the previous version). This new version even supports multiple cores, though that isn't enabled at this time. There appear to have been many other updates, but there is no ChangeLog and there aren't even any intermediate versions for download (hence using the current beta version). Upstream unfortunately makes it as difficult as possible to see the history of this package. @ text @$NetBSD: patch-ad,v 1.6 2014/02/09 16:50:45 wiedi Exp $ --- main.cpp.orig 2000-04-01 07:46:20.000000000 +0000 +++ main.cpp @@@@ -3,20 +3,23 @@@@ /* Main functions controlling program */ -#include -#include +#include +#include #include #include #include #include #include -#include +#include #include "define.h" +using namespace std; + #if UNIX #include #include + #include #else #include #include @@@@ -42,21 +45,21 @@@@ int omttc = 0, mttc = 0, inc = 0; float int display_board = 0; int analysis_mode = 0; extern int fail; // flag for fail high/fail low from search -extern move ponder_move; +extern my_move ponder_move; extern int logging; ofstream logfile; int MAX_LOGS = 100; // xboard flag -int xboard, post, ics, ALLEG = 0, hintflag = 0, count = 1; +int xboard, post, ics, ALLEG = 0, hintflag = 0, my_count = 1; int ponder_flag = 1, learn_bk, shout_book; int no_book = 0; // count of moves without a book move position reset_pos; extern int ponder, last_ponder, learn_count, learned; extern unsigned long TAB_SIZE, PAWN_SIZE; -// executable directory +// exchess opening book and search parameters directory char exec_path[100]; // performance function @@@@ -88,21 +91,12 @@@@ ofstream printer; int main(int argc, char *argv[]) { char mstring[10]; - move hint; + my_move hint; xboard = 0; ponder = 0; ics = 0; learn_count = 0; learned = 0; learn_bk = 1; shout_book = 0; - strcpy(exec_path, argv[0]); - // parsing exec path - int last_slash = 0; - for(int j = 0; j < 100; j++) { - if(exec_path[j] == '\0') break; - if(exec_path[j] == '\\') last_slash = j; - if(exec_path[j] == '/') last_slash = j; - } - - exec_path[last_slash+1] = '\0'; + strcpy(exec_path, EXCHESS_DIR); /* initializing hash tables, check tables, scoring parameters, and the random number seed and tablebases */ @@@@ -117,7 +111,7 @@@@ int main(int argc, char *argv[]) if(li < 10) sprintf(lfile, "run_log.00%i", li); else if(li < 100) sprintf(lfile, "run_log.0%i", li); else sprintf(lfile, "run_log.%i", li); - logfile.open(lfile, ios::noreplace | ios::out); + logfile.open(lfile, ios::out); if(logfile) break; } if(!logfile) { @@@@ -164,7 +158,7 @@@@ int main(int argc, char *argv[]) /* main loop */ - while (count > 0) + while (my_count > 0) { // find a hint move, check book first then look in pv @@@@ -204,14 +198,14 @@@@ int main(int argc, char *argv[]) if(!game_pos.wtm) // if it is black's turn { if(both) p_side = 0; - if(!xboard) cout << "Black-To-Move[" << ceil(T/2) << "]: "; - if(logging) logfile << "Black-To-Move[" << ceil(T/2) << "]: "; + if(!xboard) cout << "Black-To-Move[" << ceil((double)(T/2)) << "]: "; + if(logging) logfile << "Black-To-Move[" << ceil((double)(T/2)) << "]: "; } else // or if it is white's { if(both) p_side = 1; - if(!xboard) cout << "White-To-Move[" << (ceil(T/2) + 1) << "]: "; - if(logging) logfile << "White-To-Move[" << (ceil(T/2) + 1) << "]: "; + if(!xboard) cout << "White-To-Move[" << (ceil((double)(T/2)) + 1) << "]: "; + if(logging) logfile << "White-To-Move[" << (ceil((double)(T/2)) + 1) << "]: "; } cout.flush(); @@@@ -322,12 +316,12 @@@@ void make_move() if(p_side != game_pos.wtm) { if(game_pos.wtm) { - cout << (ceil(T/2) + 1) << ". "; + cout << (ceil((double)(T/2)) + 1) << ". "; if(xboard) cout << "... "; - if(logging) logfile << (ceil(T/2) + 1) << ". "; + if(logging) logfile << (ceil((double)(T/2)) + 1) << ". "; } else { - cout << ceil(T/2) << ". ... "; - if(logging) logfile << ceil(T/2) << ". ... "; + cout << ceil((double)(T/2)) << ". ... "; + if(logging) logfile << ceil((double)(T/2)) << ". ... "; } print_move(game_pos, best, mstring); cout << mstring << "\n"; @@@@ -558,7 +552,7 @@@@ void drawboard() print_move(last_pos, game_pos.last, mstring); cout << mstring; } - if(j==3) cout << " fifty: " << ceil(game_pos.fifty/2); + if(j==3) cout << " fifty: " << ceil((double)(game_pos.fifty/2)); if(j==2) cout << " Computer time: " << int(timeleft/100) << " seconds"; } cout << "\n +---+---+---+---+---+---+---+---+"; @@@@ -745,7 +739,7 @@@@ void parse_command() else if(!strcmp(response, "nopost")) { post = 0; } else if(!strcmp(response, "probe")) { cout << probe_tb(&game_pos,0) << "\n"; } else if(!strcmp(response, "save") || !strcmp(response, "SR")) { save_game(); } - else if(!strcmp(response, "quit")) { game_over = 1; count = 0; } + else if(!strcmp(response, "quit")) { game_over = 1; my_count = 0; } else if(!strcmp(response, "performance")) { performance(); } else if(!strcmp(response, "setboard")) { cin >> inboard >> ms >> castle >> ep; mttc = omttc; game_over = 0; @@@@ -795,7 +789,7 @@@@ void performance() // when the best move was first found and held on to. float soltime; -int bmcount, tsuite = 0; move bmoves[10]; +int bmcount, tsuite = 0; my_move bmoves[10]; int best_depth, best_score; extern int stage; unsigned long nodes, nodes1, test_time, test_time1; @@@@ -1063,7 +1057,7 @@@@ void save_game() for(int i = 1; i < TURN; i++) { print_move(game_pos, game_history[i-1], mstring); - if (game_pos.wtm) outfile << (ceil(i/2) + 1) << ". " << mstring; + if (game_pos.wtm) outfile << (ceil((double)(i/2)) + 1) << ". " << mstring; else outfile << mstring; outfile << " "; if(!(T%8)) outfile << "\n"; @ 1.6 log @Fix build on SunOS (u_int64_t usage and ambigous math) @ text @d1 1 a1 1 $NetBSD: patch-ad,v 1.5 2013/04/30 22:20:58 joerg Exp $ @ 1.5 log @Avoid conflict with C++11's std::move. @ text @d1 1 a1 1 $NetBSD: patch-ad,v 1.4 2012/01/20 17:07:35 joerg Exp $ d32 1 a32 1 @@@@ -42,21 +45,21 @@@@ int omttc = 0, mttc = 0, inc = 0; float d99 45 d162 9 @ 1.4 log @Rename local variable to not conflict with STL @ text @d1 1 a1 1 $NetBSD$ d32 9 a40 1 @@@@ -49,14 +52,14 @@@@ ofstream logfile; d57 7 a63 1 @@@@ -93,16 +96,7 @@@@ int main(int argc, char *argv[]) d108 9 @ 1.3 log @Fix build with modern GCC @ text @d1 1 a1 1 $NetBSD: patch-ad,v 1.2 2004/02/14 04:31:56 kristerw Exp $ d32 9 a40 1 @@@@ -56,7 +59,7 @@@@ position reset_pos; d76 18 @ 1.2 log @Make the package build when using gcc-3.3. @ text @d1 1 a1 1 $NetBSD$ d3 22 a24 3 --- main.cpp.orig 2000-04-01 07:46:20.000000000 +0200 +++ main.cpp 2004-02-14 04:58:19.000000000 +0100 @@@@ -17,6 +17,7 @@@@ d32 1 a32 1 @@@@ -56,7 +57,7 @@@@ d41 1 a41 1 @@@@ -93,16 +94,7 @@@@ d59 1 a59 1 @@@@ -117,7 +109,7 @@@@ @ 1.1 log @Initial revision @ text @d3 2 a4 2 --- main.cpp.orig Sat Apr 1 07:46:20 2000 +++ main.cpp d40 9 @ 1.1.1.1 log @EXchess - experimental chess engine (capable of beating Crafty) @ text @@