Scid  4.6.5
wbdetect.tcl
Go to the documentation of this file.
1 ###
2 ### wbdetect.tcl: part of Scid.
3 ### Copyright (C) 1999-2002 Shane Hudson.
4 # Copyright (C) 2006-2007 Pascal Georges.
5 ###
6 
7 ######################################################################
8 #
9 # Code to detect various Winboard engines being used as analysis
10 # engines in Scid.
11 #
12 # Thanks to Allen Lake for testing many WinBoard engines
13 # with Scid in Windows and providing this code.
14 #
15 # Most cases below are for engines that have analyze mode but
16 # do not let Scid know about it by sending a "feature" line
17 # with "analyze=1" in response to the "protover 2" command.
18 # Some cases also cover engines that report times in seconds
19 # instead of centiseconds.
20 
21 proc detectWBEngine { {n 1} engineOutput } {
22 
23  global analysis
24 
25  # Check for a line containing "Amy version" to detect use of
26  # the Amy 0.7 Winboard engine, which doesn't support the
27  # "setboard" command, but does support the "analyze" command.
28  if {[string match "*Amy version*" $engineOutput] } {
29  logEngineNote $n {Seen "Amy"; assuming analyze command.}
30  set analysis(has_analyze$n) 1
31  set analysis(wbEngineDetected$n) 1
32  return
33  }
34 
35  # Check for a line containing "Baron" to detect use of the
36  # Baron 0.26, 0.26a, 0.27, or 0.28a Winboard engines. These
37  # engines display analysis time in whole seconds, rather than
38  # in centiseconds, so I have added code to detect this.
39  if {[string match "*Baron*" $engineOutput] } {
40  logEngineNote $n {Seen "Baron"; assuming analyze, setboard, times in seconds.}
41  set analysis(has_setboard$n) 1
42  set analysis(has_analyze$n) 1
43  set analysis(wholeSeconds$n) 1
44  set analysis(wbEngineDetected$n) 1
45  return
46  }
47 
48  # Check for a line containing "D U K E" to detect use of
49  # the Duke 1.0 or 1.1 Winboard engines, which don't support the
50  # "setboard" command, but do support the "analyze" command.
51  if {[string match "*D U K E*" $engineOutput] } {
52  logEngineNote $n {Seen "Duke"; assuming analyze command.}
53  set analysis(has_analyze$n) 1
54  set analysis(wbEngineDetected$n) 1
55  return
56  }
57 
58  # Check for a line containing "ESCbook.bin" to detect use of
59  # the Esc 1.09 Winboard engine, which doesn't support the
60  # "setboard" command, but does support the "analyze" command.
61  if {[string match "*ESCbook.bin*" $engineOutput] } {
62  logEngineNote $n {Seen "ESC"; assuming analyze command.}
63  set analysis(has_analyze$n) 1
64  set analysis(wbEngineDetected$n) 1
65  return
66  }
67 
68  # Check for a line containing "FORTRESS" to detect use of
69  # the Fortress 1.62 Winboard engine, which doesn't support the
70  # "setboard" command, but does support the "analyze" command.
71  if {[string match "*FORTRESS*" $engineOutput] } {
72  logEngineNote $n {Seen "Fortress"; assuming analyze command.}
73  set analysis(has_analyze$n) 1
74  set analysis(wbEngineDetected$n) 1
75  return
76  }
77 
78  # Check for a line containing only "Chess", to detect the use of
79  # GNU Chess 4, which issues time in whole seconds rather than in
80  # centiseconds.
81  #if {! [string compare $engineOutput "Chess"]} {
82  # logEngineNote $n {Seen "GNU Chess 4"; assuming times in seconds.}
83  # set analysis(wholeSeconds$n) 1
84  # set analysis(wbEngineDetected$n) 1
85  # return
86  #}
87 
88  # Check for a line containing "GNU Chess v5" to detect use of
89  # the GNU Chess 5.02 or 5.03 Winboard engine, which don't support the
90  # "analyze" command, but do support the "setboard" command.
91  if {[string match "*GNU Chess v5*" $engineOutput] } {
92  logEngineNote $n {Seen "GNU Chess 5"; assuming setboard command.}
93  set analysis(has_setboard$n) 1
94  set analysis(wbEngineDetected$n) 1
95  return
96  }
97 
98  # Check for a line containing "Gromit3" to detect use of the
99  # Gromit 3.00 or Gromit 3.8.2 Winboard engine, which don't
100  # support the "setboard" command, but do support the
101  # "analyze" command.
102  if {[string match "*Gromit3*" $engineOutput] || [string match "GROMIT" $engineOutput]} {
103  logEngineNote $n {Seen "Gromit"; assuming analyze command.}
104  set analysis(has_analyze$n) 1
105  set analysis(wbEngineDetected$n) 1
106  return
107  }
108 
109  # Check for a line containing "Jester" to detect use of the
110  # Jester 0.82 Winboard engine. This engine supports "analyze"
111  # but does not support "setboard" or "protover".
112  if {[string match "*Jester*" $engineOutput] } {
113  logEngineNote $n {Seen "Jester"; assuming analyze command.}
114  set analysis(has_analyze$n) 1
115  set analysis(wbEngineDetected$n) 1
116  return
117  }
118 
119  # Check for a line containing "Calzerano" to detect use of the
120  # Leila 0.36 or Leila 0.41i Winboard engine, which don't
121  # support the "setboard" command, but do support the
122  # "analyze" command.
123  if {[string match "*Calzerano*" $engineOutput] } {
124  logEngineNote $n {Seen "Calzerano" (Leila); assuming analyze command.}
125  set analysis(has_analyze$n) 1
126  set analysis(wbEngineDetected$n) 1
127  return
128  }
129 
130  # Check for a line containing "LordKing" to detect use of the
131  # LordKing 3.0, 3.1, or 3.2 Winboard engines. These engines
132  # have "analyze", but do not support "setboard" or "protover".
133  if {[string match "*LordKing*" $engineOutput] } {
134  logEngineNote $n {Seen "LordKing"; assuming analyze command.}
135  set analysis(has_analyze$n) 1
136  set analysis(wbEngineDetected$n) 1
137  return
138  }
139 
140  # Check for a line containing "NEJMET" to detect use of the
141  # Nejmet 2.6.0 Winboard engine, which supports "setboard"
142  # and "analyze", but not "protover".
143  if {[string match "*NEJMET*" $engineOutput] } {
144  logEngineNote $n {Seen "Nejmet"; assuming analyze and setboard commands.}
145  set analysis(has_setboard$n) 1
146  set analysis(has_analyze$n) 1
147  set analysis(wbEngineDetected$n) 1
148  return
149  }
150 
151  # Check for a line containing "Nejmet" to detect use of the
152  # Nejmet 3.0.1 and 3.0.2 Winboard engines, which send
153  # "feature analyse=1" instead of "feature analyze=1".
154  if {[string match "*Nejmet*" $engineOutput] } {
155  logEngineNote $n {Seen "Nejmet"; assuming analyze and setboard commands.}
156  set analysis(has_setboard$n) 1
157  set analysis(has_analyze$n) 1
158  set analysis(wbEngineDetected$n) 1
159  return
160  }
161 
162  # Check for a line containing "Pharaon" to detect use of the
163  # Pharaon 2.50 or Pharaon 2.61 Winboard engines. These
164  # engines display analysis time in whole seconds, rather than
165  # in centiseconds, so I have added code to detect this.
166  # Performance of these engines has been somewhat uneven, with
167  # occasional crashes of the engine, but more stable and
168  # predictable with this code in place.
169  if {[string match "*Pharaon*" $engineOutput] } {
170  logEngineNote $n {Seen "Pharaon"; assuming analyze, setboard, times in seconds.}
171  set analysis(has_setboard$n) 1
172  set analysis(has_analyze$n) 1
173  set analysis(wholeSeconds$n) 1
174  set analysis(wbEngineDetected$n) 1
175  return
176  }
177 
178  # Check for a line containing "Skaki" to detect use of the
179  # Skaki 1.19 Winboard engine. This engine has "analyze",
180  # but does not support "setboard" or "protover".
181  if {[string match "*Skaki*" $engineOutput] } {
182  logEngineNote $n {Seen "Skaki"; assuming analyze command.}
183  set analysis(has_analyze$n) 1
184  set analysis(wbEngineDetected$n) 1
185  return
186  }
187 
188  # Check for a line containing "EngineControl-TCB" to detect use of the
189  # TCB 0045 Winboard engine. This engine has "analyze",
190  # but does not support "setboard" or "protover".
191  if {[string match "*EngineControl-TCB*" $engineOutput] } {
192  logEngineNote $n {Seen "TCB"; assuming analyze and setboard commands.}
193  set analysis(has_analyze$n) 1
194  set analysis(wbEngineDetected$n) 1
195  return
196  }
197 
198  # Check for a line containing "ZChess" to detect use of the
199  # ZChess 2.22 Winboard engine. ZChess is the predecessor
200  # of the Pharaon series of Winboard engines and, as such,
201  # displays analysis time in whole seconds, rather than
202  # in centiseconds.
203  if {[string match "*ZChess*" $engineOutput] } {
204  logEngineNote $n {Seen "ZChess"; assuming analyze, setboard, times in seconds.}
205  set analysis(has_analyze$n) 1
206  set analysis(wholeSeconds$n) 1
207  set analysis(wbEngineDetected$n) 1
208  return
209  }
210 
211  # Check for a line containing "King of Kings" to detect use
212  # of the King of Kings 2.02 Winboard engine. KofK uses the
213  # "protover" command, but seems to confuse previous code on
214  # Win98SE. Setting analysis(has_setboard$n) and
215  # analysis(has_analyze$n) explicitly seems to help.
216  if {[string match "*King of Kings*" $engineOutput] } {
217  logEngineNote $n {Seen "King of Kings"; assuming analyze and setboard commands.}
218  set analysis(has_setboard$n) 1
219  set analysis(has_analyze$n) 1
220  set analysis(wbEngineDetected$n) 1
221  return
222  }
223 
224  # Check for a line containing "EXchess" to detect use of the
225  # EXchess 4.02 or 4.03 Winboard engine, which supports "setboard"
226  # and "analyze", but not "protover".
227  if {[string match "*EXchess*" $engineOutput] } {
228  logEngineNote $n {Seen "EXchess"; assuming analyze and setboard commands.}
229  set analysis(has_setboard$n) 1
230  set analysis(has_analyze$n) 1
231  set analysis(wbEngineDetected$n) 1
232  return
233  }
234 
235  # Check for a line containing "WildCat version 2.61" to detect use of the
236  # WildCat 2.61 Winboard engine, which supports "analyze"
237  # but not "setboard" or "protover".
238  if {[string match "*WildCat version 2.61*" $engineOutput] } {
239  logEngineNote $n {Seen "WildCat 2.61"; assuming analyze and setboard commands.}
240  set analysis(has_analyze$n) 1
241  set analysis(wbEngineDetected$n) 1
242  return
243  }
244 
245 
246  # Check for a line containing "Phalanx" to detect use of the
247  # Phalanx Winboard engine, which supports "analyze"
248  # but not "setboard" or "protover".
249  if {[string match "*Phalanx*" $engineOutput] } {
250  logEngineNote $n {Seen "Phalanx"; assuming analyze command.}
251  set analysis(has_analyze$n) 1
252  set analysis(wbEngineDetected$n) 1
253  set analysis(has_setboard$n) 1
254  return
255  }
256 
257  # Check for a line containing "Scorpio" , which supports "analyze"
258  # and "setboard".
259  if {[string match -nocase "*Scorpio*" $engineOutput] } {
260  logEngineNote $n {Seen "Scorpio"; assuming analyze command.}
261  set analysis(has_analyze$n) 1
262  set analysis(wbEngineDetected$n) 1
263  return
264  }
265 
266 }
267 
268 ###
269 ### End of file: wbdetect.tcl
270 ###