This patch: 1) Correct the class StoredLine so it can be used as an object2) Change ::board::colorSquare so that textures are hided and not destroyed. This allow proc leaveSquare to not call ::board::update, solving some subtle bugs when the cpu is 100% and the user move fast over the board 3) Change the FinishGame button behavior for uci engines. If you have two engines opened you can let play one vs the other.
Please try this with different OS and different engines and report any bug. Bye, Fulvio
? .cproject ? .project ? Makefile ? pgnfix ? pgnscid ? sc_addmove ? sc_eco ? sc_epgn ? sc_import ? sc_remote ? sc_spell ? sc_tree ? scid ? scidlet ? scidpgn ? scidt ? scmerge ? spf2spi ? spliteco ? tcscid ? tkscid ? engines/phalanx-scid/phalanx-scid ? engines/togaII1.2.1a/src/.depend ? engines/togaII1.2.1a/src/togaII Index: src/stored.cpp =================================================================== RCS file: /cvsroot/scid/scid/src/stored.cpp,v retrieving revision 1.3 diff -u -8 -p -r1.3 stored.cpp --- src/stored.cpp 22 Jun 2008 21:46:47 -0000 1.3 +++ src/stored.cpp 29 Dec 2010 16:44:48 -0000 @@ -375,11 +375,28 @@ Game * StoredLine::GetGame (uint code) { if (storedLineGames == NULL) { Init(); } if (code < 1 || code > nStoredLines) { return NULL; } return storedLineGames [code]; } +StoredLine::StoredLine(Position* pos) { + if (storedLineGames == NULL) { Init(); } + + for (int line = StoredLine::Count(); line > 0; --line) { + Game * lineGame = storedLineGames [line]; + lineGame->MoveToPly (0); + bool never_match = false; + if (lineGame->ExactMatch (pos, NULL, &storedLineMoves_[line], &never_match)) { + if (storedLineMoves_[line].from != NULL_SQUARE) { + storedLineMatches_[line] = lineGame->GetCurrentPly() + 1; + } + } else + if (never_match) storedLineMatches_[line] = -1; + else storedLineMatches_[line] = 0; + } +} + ////////////////////////////////////////////////////////////////////// // EOF: stored.cpp ////////////////////////////////////////////////////////////////////// Index: src/stored.h =================================================================== RCS file: /cvsroot/scid/scid/src/stored.h,v retrieving revision 1.3 diff -u -8 -p -r1.3 stored.h --- src/stored.h 22 Jun 2008 21:46:47 -0000 1.3 +++ src/stored.h 29 Dec 2010 16:44:48 -0000 @@ -17,16 +17,18 @@ #include "game.h" const uint MAX_STORED_LINES = 256; class StoredLine { private: + int storedLineMatches_ [MAX_STORED_LINES]; + simpleMoveT storedLineMoves_ [MAX_STORED_LINES]; static void Init (void); public: #ifdef WINCE void* operator new(size_t sz) { void* m = my_Tcl_Alloc(sz); return m; @@ -40,16 +42,24 @@ class StoredLine { } void operator delete [] (void* m) { my_Tcl_Free((char*)m); } #endif + StoredLine(Position* pos); + bool CanMatch(uint ln, uint* ply, simpleMoveT* sm){ + if (ln == 0 || ln > StoredLine::Count()) return true; + if (storedLineMatches_[ln] < 0 ) return false; + *ply = storedLineMatches_[ln]; + if (storedLineMatches_[ln] > 0) *sm = storedLineMoves_[ln]; + return true; + } static void FreeStoredLine (); static uint Count (void); static const char * GetText (uint code); static Game * GetGame (uint code); static bool isInitialized(void); }; #endif // #ifndef SCID_STORED_H Index: src/tkscid.cpp =================================================================== RCS file: /cvsroot/scid/scid/src/tkscid.cpp,v retrieving revision 1.63 diff -u -8 -p -r1.63 tkscid.cpp --- src/tkscid.cpp 23 Dec 2010 17:00:21 -0000 1.63 +++ src/tkscid.cpp 29 Dec 2010 16:45:08 -0000 @@ -13704,47 +13704,17 @@ sc_tree_search (ClientData cd, Tcl_Inter uint hpSig = pos->GetHPSig(); simpleMoveT sm; base->treeFilter->Fill (0); // Reset the filter to be empty skipcount = 0; uint updateStart = 5000; // Update progress bar every 5000 games uint update = 1; // 3. Set up the stored line code matches: - uint numStoredLines = StoredLine::Count(); - byte storedLineMatches [MAX_STORED_LINES]; - simpleMoveT storedLineMoves [MAX_STORED_LINES]; - bool storedLineNeverMatches [MAX_STORED_LINES]; - pieceT * bd = pos->GetBoard(); - bool isStartPos = - (bd[A1]==WR && bd[B1]==WN && bd[C1]==WB && bd[D1]==WQ && - bd[E1]==WK && bd[F1]==WB && bd[G1]==WN && bd[H1]==WR && - bd[A2]==WP && bd[B2]==WP && bd[C2]==WP && bd[D2]==WP && - bd[E2]==WP && bd[F2]==WP && bd[G2]==WP && bd[H2]==WP && - bd[A7]==BP && bd[B7]==BP && bd[C7]==BP && bd[D7]==BP && - bd[E7]==BP && bd[F7]==BP && bd[G7]==BP && bd[H7]==BP && - bd[A8]==BR && bd[B8]==BN && bd[C8]==BB && bd[D8]==BQ && - bd[E8]==BK && bd[F8]==BB && bd[G8]==BN && bd[H8]==BR); - - for (uint line = 1; line <= numStoredLines; line++) { - Game * lineGame = StoredLine::GetGame (line); - lineGame->MoveToPly (0); - storedLineMatches[line] = 0; - storedLineNeverMatches[line] = false; - bool b = false; - if (lineGame->ExactMatch (pos, NULL, &sm, &b)) { - if (sm.from != NULL_SQUARE) { - storedLineMatches[line] = lineGame->GetCurrentPly() + 1; - storedLineMoves[line] = sm; - } - } else { - if (b) { storedLineNeverMatches[line] = true; } - } - } - // Finished setting up stored line results. + StoredLine stored_line(pos); // 4. Search through each game: for (uint i=0; i < base->numGames; i++) { if (showProgress) { // Update the percentage done slider: update--; if (update == 0) { update = updateStart; updateProgressBar (ti, i, base->numGames); @@ -13771,28 +13741,32 @@ sc_tree_search (ClientData cd, Tcl_Inter if (ie->GetLength() == 0) { skipcount++; continue; } // We do not skip deleted games, so next line is commented out: // if (ie->GetDeleteFlag()) { skipcount++; continue; } bool foundMatch = false; uint ply = 0; // Check the stored line result for this game: - uint storedLine = ie->GetStoredLineCode(); - if (storedLine > 0 && storedLine < numStoredLines) { - if (storedLineMatches[storedLine] != 0) { - foundMatch = true; - ply = storedLineMatches[storedLine]; - sm = storedLineMoves[storedLine]; - } else if (storedLineNeverMatches[storedLine]) { - skipcount++; - continue; - } + if (! stored_line.CanMatch(ie->GetStoredLineCode(), &ply, &sm)) { + skipcount++; + continue; } + if (ply > 0) foundMatch = true; + pieceT * bd = pos->GetBoard(); + bool isStartPos = + (bd[A1]==WR && bd[B1]==WN && bd[C1]==WB && bd[D1]==WQ && + bd[E1]==WK && bd[F1]==WB && bd[G1]==WN && bd[H1]==WR && + bd[A2]==WP && bd[B2]==WP && bd[C2]==WP && bd[D2]==WP && + bd[E2]==WP && bd[F2]==WP && bd[G2]==WP && bd[H2]==WP && + bd[A7]==BP && bd[B7]==BP && bd[C7]==BP && bd[D7]==BP && + bd[E7]==BP && bd[F7]==BP && bd[G7]==BP && bd[H7]==BP && + bd[A8]==BR && bd[B8]==BN && bd[C8]==BB && bd[D8]==BQ && + bd[E8]==BK && bd[F8]==BB && bd[G8]==BN && bd[H8]==BR); if (!isStartPos && ie->GetNumHalfMoves() == 0) { skipcount++; continue; } if (!foundMatch && ! ie->GetStartFlag()) { // Speedups that only apply to standard start games: if (hpSig != HPSIG_StdStart) { // Not the start mask @@ -13955,19 +13929,19 @@ sc_tree_search (ClientData cd, Tcl_Inter } // Now we print the list into the return string: node = tree->node; for (uint count=0; count < tree->moveCount; count++, node++) { ecoStringT ecoStr; eco_ToExtendedString (node->ecoCode, ecoStr); uint avgElo = 0; - if (node->eloCount >= 10) {bool foundInCache = false; - avgElo = node->eloSum / node->eloCount; - } + if (node->eloCount >= 10) + avgElo = node->eloSum / node->eloCount; + uint perf = 0; if (node->perfCount >= 10) { perf = node->perfSum / node->perfCount; uint score = (node->score + 5) / 10; if (db->game->GetCurrentPos()->GetToMove() == BLACK) { score = 100 - score; } #ifndef WINCE perf = Crosstable::Performance (perf, score); #endif Index: tcl/board.tcl =================================================================== RCS file: /cvsroot/scid/scid/tcl/board.tcl,v retrieving revision 1.35 diff -u -8 -p -r1.35 board.tcl --- tcl/board.tcl 13 Apr 2010 19:23:12 -0000 1.35 +++ tcl/board.tcl 29 Dec 2010 16:45:11 -0000 @@ -1328,57 +1328,23 @@ proc ::board::showMarks {w value} { # ::board::colorSquare # Colors the specified square (0-63) of the board. # If the color is the empty string, the appropriate # color for the square (light or dark) is used. # proc ::board::colorSquare {w i {color ""}} { if {$i < 0 || $i > 63} { return } if {$color != ""} { - $w.bd delete br$i - $w.bd itemconfigure sq$i -fill $color -outline "" ;# -outline $color - return - } - set color [::board::defaultColor $i] - $w.bd itemconfigure sq$i -fill $color -outline "" ; #-outline $color - #this inserts a textures on a square and restore piece - set midpoint [::board::midSquare $w $i] - set xc [lindex $midpoint 0] - set yc [lindex $midpoint 1] - set psize $::board::_size($w) - set boc bgd$psize - if { ($i + ($i / 8)) % 2 } { set boc bgl$psize } - $w.bd delete br$i - - $w.bd create image $xc $yc -image $boc -tag br$i - # otherwise clicking 3 times on an empty square will prevent the binding to work - $w.bd lower br$i p$i - - set piece [string index $::board::_data($w) $i] - if { $piece != "." } { - set flip $::board::_flip($w) - $w.bd delete p$i - $w.bd create image $xc $yc -image $::board::letterToPiece($piece)$psize -tag p$i - } - - if {[info exists ::board::_mark($w)]} { - set color "" - foreach mark $::board::_mark($w) { - set type [lindex $mark 0] - set square [lindex $mark 1] - if {$square == $i} { - if {$type == "full"} { set color [lindex $mark 3] } - if {$type == "DEL"} { set color "" } - } - } - if {![string equal $color ""]} { - catch {$w.bd itemconfigure sq$i -outline "" -fill $color } ; # -outline $color - } + $w.bd itemconfigure br$i -state hidden + } else { + set color [::board::defaultColor $i] + $w.bd itemconfigure br$i -state normal } + $w.bd itemconfigure sq$i -fill $color -outline "" } # ::board::midSquare # Given a board and square number, returns the canvas X/Y # coordinates of the midpoint of that square. # proc ::board::midSquare {w sq} { set c [$w.bd coords sq$sq] @@ -2018,17 +1984,17 @@ proc ::board::lastMoveHighlight {w} { # Update the board given a 64-character board string as returned # by the "sc_pos board" command. If the board string is empty, it # defaults to the previous value for this board. # If the optional paramater "animate" is 1 and the changes from # the previous board state appear to be a valid chess move, the # move is animated. # proc ::board::update {w {board ""} {animate 0}} { - global highcolor currentSq bestSq bestcolor selectedSq + global highcolor bestcolor selectedSq set oldboard $::board::_data($w) if {$board == ""} { set board $::board::_data($w) } else { set ::board::_data($w) $board } set psize $::board::_size($w) Index: tcl/main.tcl =================================================================== RCS file: /cvsroot/scid/scid/tcl/main.tcl,v retrieving revision 1.55 diff -u -8 -p -r1.55 main.tcl --- tcl/main.tcl 25 Dec 2010 16:53:10 -0000 1.55 +++ tcl/main.tcl 29 Dec 2010 16:45:14 -0000 @@ -1227,17 +1227,16 @@ proc togglePhotosSize {} { } ######################################################### ### Chess move input # Globals for mouse-based move input: set selectedSq -1 -set currentSq -1 set bestSq -1 set EMPTY 0 set KING 1 set QUEEN 2 set ROOK 3 set BISHOP 4 set KNIGHT 5 @@ -1480,45 +1479,39 @@ proc addSanMove {san {animate ""} {noTra } # enterSquare: # Called when the mouse pointer enters a board square. # Finds the best matching square for a move (if there is a # legal move to or from this square), and colors the squares # to indicate the suggested move. # -proc enterSquare { square } { - global highcolor currentSq bestSq bestcolor selectedSq suggestMoves - set currentSq $square +proc enterSquare { square } { + global bestSq bestcolor selectedSq suggestMoves if {$selectedSq == -1} { set bestSq -1 if {$suggestMoves} { set bestSq [sc_pos bestSquare $square] - } - if {[expr {$bestSq != -1}]} { - ::board::colorSquare .main.board $square $bestcolor - ::board::colorSquare .main.board $bestSq $bestcolor + if {$bestSq != -1} { + ::board::colorSquare .main.board $square $bestcolor + ::board::colorSquare .main.board $bestSq $bestcolor + } } } } # leaveSquare: # Called when the mouse pointer leaves a board square. # Recolors squares to normal (lite/dark) color. # proc leaveSquare { square } { - global currentSq selectedSq bestSq - #Klimmek: not needed anymore - # if {$square != $selectedSq} { - # ::board::colorSquare .main.board $square - # } - if {$bestSq != -1} { - #Klimmek: changed, because Scid "hangs" very often (after 5-7 moves) - # ::board::colorSquare .main.board $bestSq - ::board::update .main.board + global selectedSq bestSq + if {$selectedSq == -1} { + ::board::colorSquare .main.board $bestSq + ::board::colorSquare .main.board $square } } # pressSquare: # Called when the left mouse button is pressed on a square. Sets # that square to be the selected square. # proc pressSquare { square } { @@ -1572,17 +1565,17 @@ proc pressSquare2 { square } { # If the square is different to that the button was pressed on, it # is a dragged move; otherwise it is just selecting this square as # part of a move. # proc releaseSquare { w x y } { if { [winfo exists .calvarWin] } { return } - global selectedSq bestSq currentSq + global selectedSq bestSq ::board::setDragSquare $w -1 set square [::board::getSquare $w $x $y] if {$square < 0} { set selectedSq -1 return } Index: tcl/tools/analysis.tcl =================================================================== RCS file: /cvsroot/scid/scid/tcl/tools/analysis.tcl,v retrieving revision 1.71 diff -u -8 -p -r1.71 analysis.tcl --- tcl/tools/analysis.tcl 22 Dec 2010 19:42:06 -0000 1.71 +++ tcl/tools/analysis.tcl 29 Dec 2010 16:45:18 -0000 @@ -1556,17 +1556,17 @@ proc addAnalysisToComment {line {n 1}} { } else { sc_pos setComment $newText } ::pgn::Refresh 1 } ################################################################################ # ################################################################################ -proc makeAnalysisMove {{n 1}} { +proc makeAnalysisMove {{n 1} {comment ""}} { set s $::analysis(moves$n) set res 1 while {1} { if {[string length $s] == 0} { return 0 } set c [string index $s 0] switch -- $c { a - b - c - d - e - f - g - h - K - Q - R - B - N - O { @@ -1578,33 +1578,39 @@ proc makeAnalysisMove {{n 1}} { if {[scan $s "%s" move] != 1} { set res 0 } set action "replace" if {! [sc_pos isAt vend]} { set action [confirmReplaceMove] } if {$action == "cancel"} { return } set ::analysis(automoveThinking$n) 0 if {$action == "var"} { sc_var create } - if { [sc_move_add $move $n] } { puts "erreur de sc_move_add" ; set res 0 } + if { [sc_move_add $move $n] } { + set res 0 + } else { + sc_pos setComment $comment + } updateBoard -pgn -animate ::utils::sound::AnnounceNewMove $move return $res } ################################################################################ # ################################################################################ # destroyAnalysisWin: # Closes an engine, because its analysis window is being destroyed. # proc destroyAnalysisWin {{n 1}} { global windowsOS analysis annotateMode + if {$::finishGameMode} { toggleFinishGame } + if { $n == 1 && $annotateMode } { toggleAutoplay } # Check the pipe is not already closed: if {$analysis(pipe$n) == ""} { set ::analysisWin$n 0 return @@ -2318,36 +2324,198 @@ proc formatAnalysisMoves {text} { # Yace often adds "H" after a move, e.g. "Bc4H". Remove them: regsub -all "H " $text " " text # Crafty adds "<HT>" for a hash table comment. Change it to "{HT}": regsub "<HT>" $text "{HT}" text return $text } + +set finishGameMode 0 +set finishGameEng1 1 +set finishGameEng2 1 +set finishGameCmd1 "movetime" +set finishGameCmdVal1 5 +set finishGameCmd2 "movetime" +set finishGameCmdVal2 5 +set finishGameAnnotate 1 + ################################################################################ -# will ask engine to play the game till the end +# will ask engine(s) to play the game till the end ################################################################################ proc toggleFinishGame { { n 1 } } { global analysis set b ".analysisWin$n.b1.bFinishGame" - - if { $::annotateModeButtonValue || $::autoplayMode || !$analysis(analyzeMode$n) || ! [sc_pos isAt vend] } { - return + if { $::annotateModeButtonValue || $::autoplayMode } { return } + if { ! $analysis(uci$n) } { + if { !$analysis(analyzeMode$n) || ! [sc_pos isAt vend] } { return } + + if {!$::finishGameMode} { + set ::finishGameMode 1 + $b configure -image finish_on -relief flat + after $::autoplayDelay autoplayFinishGame + } else { + set ::finishGameMode 0 + $b configure -image finish_off -relief flat + after cancel autoplayFinishGame + } + return } - - if {!$::finishGameMode} { - set ::finishGameMode 1 - $b configure -image finish_on -relief flat - after $::autoplayDelay autoplayFinishGame - } else { + + if {$::finishGameMode} { set ::finishGameMode 0 - $b configure -image finish_off -relief flat - after cancel autoplayFinishGame - } + sendToEngine 1 "stop" + set analysis(waitForReadyOk1) 0 + set analysis(waitForBestMove1) 0 + sendToEngine 2 "stop" + set analysis(waitForReadyOk2) 0 + set analysis(waitForBestMove2) 0 + $b configure -image finish_off -relief flat + grab release .analysisWin$n + .analysisWin$n.b1.bStartStop configure -state normal + .analysisWin$n.b1.move configure -state normal + .analysisWin$n.b1.line configure -state normal + .analysisWin$n.b1.alllines configure -state normal + .analysisWin$n.b1.annotate configure -state normal + .analysisWin$n.b1.automove configure -state normal + return + } + + set w .configFinishGame + toplevel $w -class Dialog -bg [ttk::style lookup . -background] + wm resizable $w 0 0 + ::setTitle $w "Scid: $::tr(FinishGame)" + + ttk::labelframe $w.wh_f -text "$::tr(White)" -padding 5 + grid $w.wh_f -column 0 -row 0 -columnspan 2 -sticky we -pady 8 + label $w.wh_f.p -image wk$::board::_size(.main.board) + grid $w.wh_f.p -column 0 -row 0 -rowspan 3 + ttk::radiobutton $w.wh_f.e1 -text $analysis(name1) -variable ::finishGameEng1 -value 1 + if {[winfo exists .analysisWin2] } { + ttk::radiobutton $w.wh_f.e2 -text $analysis(name2) -variable ::finishGameEng1 -value 2 + } else { + ttk::radiobutton $w.wh_f.e2 -text $::tr(StartEngine) -variable ::finishGameEng1 -value 2 -state disabled + } + grid $w.wh_f.e1 -column 1 -row 0 -columnspan 3 -sticky w + grid $w.wh_f.e2 -column 1 -row 1 -columnspan 3 -sticky w + spinbox $w.wh_f.cv -width 4 -textvariable ::finishGameCmdVal1 -from 1 -to 999 + ttk::radiobutton $w.wh_f.c1 -text $::tr(seconds) -variable ::finishGameCmd1 -value "movetime" + ttk::radiobutton $w.wh_f.c2 -text $::tr(FixedDepth) -variable ::finishGameCmd1 -value "depth" + grid $w.wh_f.cv -column 1 -row 2 -sticky w + grid $w.wh_f.c1 -column 2 -row 2 -sticky w + grid $w.wh_f.c2 -column 3 -row 2 -sticky w + grid columnconfigure $w.wh_f 2 -weight 1 + + ttk::labelframe $w.bk_f -text "$::tr(Black)" -padding 5 + grid $w.bk_f -column 0 -row 1 -columnspan 2 -sticky we -pady 8 + label $w.bk_f.p -image bk$::board::_size(.main.board) + grid $w.bk_f.p -column 0 -row 0 -rowspan 3 + ttk::radiobutton $w.bk_f.e1 -text $analysis(name1) -variable ::finishGameEng2 -value 1 + if {[winfo exists .analysisWin2] } { + ttk::radiobutton $w.bk_f.e2 -text $analysis(name2) -variable ::finishGameEng2 -value 2 + } else { + ttk::radiobutton $w.bk_f.e2 -text $::tr(StartEngine) -variable ::finishGameEng2 -value 2 -state disabled + } + grid $w.bk_f.e1 -column 1 -row 0 -columnspan 3 -sticky w + grid $w.bk_f.e2 -column 1 -row 1 -columnspan 3 -sticky w + spinbox $w.bk_f.cv -width 4 -textvariable ::finishGameCmdVal2 -from 1 -to 999 + ttk::radiobutton $w.bk_f.c1 -text $::tr(seconds) -variable ::finishGameCmd2 -value "movetime" + ttk::radiobutton $w.bk_f.c2 -text $::tr(FixedDepth) -variable ::finishGameCmd2 -value "depth" + grid $w.bk_f.cv -column 1 -row 2 -sticky w + grid $w.bk_f.c1 -column 2 -row 2 -sticky w + grid $w.bk_f.c2 -column 3 -row 2 -sticky w + grid columnconfigure $w.bk_f 2 -weight 1 + + ttk::checkbutton $w.annotate -text $::tr(Annotate) -variable ::finishGameAnnotate + grid $w.annotate -column 0 -row 2 -columnspan 2 -sticky w -padx 5 -pady 8 + + ttk::button $w.cancel -text $::tr(Cancel) -command { destroy .configFinishGame } + grid $w.cancel -column 0 -row 3 + ttk::button $w.ok -text "OK" -command { + if {$::finishGameEng1 == $::finishGameEng2} { + set ::finishGameMode 1 + } else { + set ::finishGameMode 2 + } + destroy .configFinishGame + } + grid $w.ok -column 1 -row 3 + focus $w.ok + bind $w <Escape> { .configFinishGame.cancel invoke } + bind $w <Return> { .configFinishGame.ok invoke } + bind $w <Destroy> { focus .analysisWin1 } + ::tk::PlaceWindow $w widget .analysisWin1 + grab $w + bind $w <ButtonPress> { + set w .configFinishGame + wm deiconify $w + if {%x < 0 || %x > [winfo width $w] || %y < 0 || %y > [winfo height $w] } { ::tk::PlaceWindow $w pointer } + } + tkwait window $w + if {!$::finishGameMode} { return } + + set gocmd(1) "go $::finishGameCmd1 $::finishGameCmdVal1" + set gocmd(2) "go $::finishGameCmd2 $::finishGameCmdVal2" + if {$::finishGameCmd1 == "movetime" } { append gocmd(1) "000" } + if {$::finishGameCmd2 == "movetime" } { append gocmd(2) "000" } + if {[sc_pos side] == "white"} { + set current_cmd 1 + set current_engine $::finishGameEng1 + } else { + set current_cmd 2 + set current_engine $::finishGameEng2 + } + + stopEngineAnalysis 1 + stopEngineAnalysis 2 + $b configure -image finish_on -relief flat + .analysisWin$n.b1.bStartStop configure -state disabled + .analysisWin$n.b1.move configure -state disabled + .analysisWin$n.b1.line configure -state disabled + .analysisWin$n.b1.alllines configure -state disabled + .analysisWin$n.b1.annotate configure -state disabled + .analysisWin$n.b1.automove configure -state disabled + grab .analysisWin$n + + while { [string index [sc_game info previousMove] end] != "#"} { + set analysis(waitForReadyOk$current_engine) 1 + sendToEngine $current_engine "isready" + vwait analysis(waitForReadyOk$current_engine) + if {!$::finishGameMode} { break } + sendToEngine $current_engine "position fen [sc_pos fen]" + sendToEngine $current_engine $gocmd($current_cmd) + set analysis(fen$current_engine) [sc_pos fen] + set analysis(maxmovenumber$current_engine) 0 + set analysis(waitForBestMove$current_engine) 1 + vwait analysis(waitForBestMove$current_engine) + if {!$::finishGameMode} { break } + + if { ! [sc_pos isAt vend] } { sc_var create } + if {$::finishGameAnnotate} { + set moves [ lindex [ lindex $analysis(multiPV$current_engine) 0 ] 2 ] + set text [format "%+.2f %s - %s Depth: %d Time:%6.2f s" \ + $analysis(score$current_engine) \ + [addMoveNumbers $current_engine [::trans $moves]] \ + $analysis(name$current_engine) \ + $analysis(depth$current_engine) \ + $analysis(time$current_engine) ] + makeAnalysisMove $current_engine $text + } else { + makeAnalysisMove $current_engine + } + + incr current_cmd + if {$current_cmd > 2} { set current_cmd 1 } + if {$::finishGameMode == 2} { + incr current_engine + if {$current_engine > 2 } { set current_engine 1 } + } + } + if {$::finishGameMode} { toggleFinishGame } } ################################################################################ # ################################################################################ proc autoplayFinishGame { {n 1} } { if {!$::finishGameMode || ![winfo exists .analysisWin$n]} {return} .analysisWin$n.b1.move invoke if { [string index [sc_game info previousMove] end] == "#"} {
------------------------------------------------------------------------------ Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________ Scid-users mailing list Scid-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/scid-users