How does this look? should I add some other path? what should be done
if no engines are found?
# Read the user Engine List file now:
#
catch { ::enginelist::read }
if {[llength $engines(list)] == 0} {
# No engines, so set up a default engine list:
set scidlet "scidlet"
set crafty "crafty"
if { $::windowsOS } {
set scidlet "scidlet.exe"
set crafty "wcrafty.exe"
}
set scidEngCmds [list \
phalanx \
fruit \
$scidlet \
$crafty \
]
set scidEngNames [list \
Phalanx \
Toga \
Scidlet \
Crafty \
]
set scidEngDir ""
set paths [list \
/usr/local/share/scid/engines \
$::scidExeDir \
$::scidShareDir \
]
set parentDirs [list \
"/Phalanx-XXII" \
"/togaII1.2.1a" \
"" \
"/crafty-21.6" \
]
set enginesNumber 0
foreach cmd $scidEngCmds name $scidEngNames \
parent $parentDirs uci {0 1 0 0} {
foreach path $paths {
if { [file executable "${path}${parent}/$cmd"] } {
engine [list \
Name $name \
Cmd "$path${parent}/$cmd" \
Dir . \
UCI $uci \
UCIoptions {} \
]
incr engineNumber
break
} elseif { [file executable "${path}/$cmd"] } {
engine [list \
Name $name \
Cmd "${path}/$cmd" \
Dir . \
UCI $uci \
UCIoptions {} \
]
break
incr engineNumber
}
}
}
if { $enginesNumber = 0 } {
#What to do if no engines found?
}
}
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Scid-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scid-users