Bugs: Browse | Submit New | Admin

[#6107] Detection of checkmate in lookahead causes null pointer lookup

Date:
2006-10-12 04:00
Priority:
3
Submitted By:
Glenn Lewis (gmlewis)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Detection of checkmate in lookahead causes null pointer lookup

Detailed description
Here is a dump of the error:

kingix is NIL!!!  color=-1... about to crash
./nchess6.rb:1924:in `[]': no implicit conversion from nil to integer (TypeError)
        from ./nchess6.rb:1924:in `Eval'
        from ./nchess6.rb:1918:in `each'
        from ./nchess6.rb:1918:in `Eval'
        from ./nchess6.rb:1781:in `Eval'
        from ./nchess6.rb:2407:in `ABnegaSearchZWTail'
        from ./nchess6.rb:2383:in `times'
        from ./nchess6.rb:2383:in `ABnegaSearchZWTail'
        from ./nchess6.rb:2457:in `ABnegaSearchZWTail'
         ... 11 levels...
        from board.rb:1028:in `PrepareForNextMoveWhenOpponentThinks'
        from board.rb:812:in `replaystart'
        from board.rb:230:in `build'
        from board.rb:1079 

Note that this could be worked around, but shouldn't be...
This indicates that there are fundamental bug(s) in the chess engine
that need to be fixed.

The biggest challenge with this port was that zero (0) evaluates to TRUE
in Ruby but evaluates to FALSE in Python (and Perl), unfortunately.
I believe it is this kind of logical checking somewhere that is causing this problem.

I've provided the original Python source so that line-by-line comparisons can be made (even though the line numbers
don't match up exactly, you know what I mean).

-- Glenn

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item