abahm/Chess.jl

Crash

Opened this issue · 1 comments

I got the following stacktrace

Julia Chess, v0.70
FEN r1bk1b1r/1pp2ppp/8/52/6/2P5/P2BPPP/R1B2RK1 w  -
ERROR: LoadError: BoundsError: attempt to access 12×64 Array{UInt64,2} at index [0, 33]
Stacktrace:
 [1] getindex at ./array.jl:729 [inlined]
 [2] getindex at ./multidimensional.jl:486 [inlined]
 [3] update_hash at /home/peep/Chess.jl/src/Zobrist.jl:19 [inlined]
 [4] compute_hash at /home/peep/Chess.jl/src/board.jl:234 [inlined]
 [5] printbd(::Main.Chess.Board, ::Base.TTY, ::Nothing) at /home/peep/Chess.jl/src/board.jl:243
 [6] printbd(::Main.Chess.Board) at /home/peep/Chess.jl/src/board.jl:241
 [7] repl_loop() at /home/peep/Chess.jl/src/play_original.jl:82
 [8] top-level scope at /home/peep/Chess.jl/src/Chess.jl:44
in expression starting at /home/peep/Chess.jl/src/Chess.jl:38

If you load up that FEN you'll see that its crazy, two darksquared bishops?
This is my attempt at correcting the FEN position from memory
a7 should be a black pawn
h2 should be a white pawn
d2 should be on e2
e2 should be taken (or on e5 i can't remember)
f3 should be a white night

After playing g2c3 (pawn takes night) as white.

After the crash the game history vanished, but if my memory serves me the game went as follows (Alekhine Defense two pawns attack)

e4
Nf6
e5
Nd5
c4
Nb6
d4
Nc6

After that i can't remember any more of the game

Hopefully this helps you improve Chess.jl :)

EDIT: After playing another game, it seems something is your with your FEN, the board is represented fine -- but the FEN is often off

abahm commented

Thanks for the report @UlisseMini ! I've been swamped, but hope to get back to this project soon. I'll definitely have a look at this.