No apology necessary… how many projects out there have major
version numbers less than 1?
Thanks, Hal! I appreciate it.
When you say it crashes, do you mean that literally? Or what?
No, sorry. It exits with an error message, like this, for
kingix is NIL!!! color=-1… about to crash
': no implicit conversion from nil to integer (TypeError) from ./nchess6.rb:1924:inEval’
each' from ./nchess6.rb:1918:inEval’
Eval' from ./nchess6.rb:2407:inABnegaSearchZWTail’
times' from ./nchess6.rb:2383:inABnegaSearchZWTail’
ABnegaSearchZWTail' ... 11 levels... from board.rb:1028:inPrepareForNextMoveWhenOpponentThinks’
replaystart' from board.rb:230:inbuild’
While I could easily prevent that particular ?crash? from happening, it
is indicative of
an error somewhere in the engine that needs to be fixed, so I?m not just
plugging the hole,
if that makes any sense.
Is part of this in C?
No, it is 100% pure Ruby. It is a line-by-line port of the
only one tiny tweak I made myself because I had always wanted the python
draw a red box around where it last moved from to where it last moved
to, in case I was
looking away when it moved.
Is Ruby’s performance acceptable (up till the time it dies)?
Well, that is an excellent question. At work, I?ve got a
brand new screaming
Core Duo machine, and the performance is great. But if you run the
side-by-side with the Ruby version, the python version is easily 10x
faster, and sometimes
100x faster based purely on the ?number of nodes? it processes during
the game, which
it reports in the GUI. So most of the time Ruby will process ~200
python would be processing ~4000 nodes/second. Sad, but true. I wish
would just step in and make an ?-O? flag for ruby that either
byte-compiled the script
or native-compiled it and then ran it.