diff --git a/Chess/nimfish.nimble b/Chess/nimfish.nimble index 7937c72..36d55f0 100644 --- a/Chess/nimfish.nimble +++ b/Chess/nimfish.nimble @@ -12,7 +12,7 @@ bin = @["nimfish"] # Dependencies -requires "nim >= 2.0" +requires "nim >= 2.0.4" requires "jsony >= 1.1.5" diff --git a/Chess/nimfish/nimfishpkg/magics.nim b/Chess/nimfish/nimfishpkg/magics.nim index d392eeb..0e0d829 100644 --- a/Chess/nimfish/nimfishpkg/magics.nim +++ b/Chess/nimfish/nimfishpkg/magics.nim @@ -235,10 +235,10 @@ proc attemptMagicTableCreation(kind: PieceKind, square: Square, entry: MagicEntr ## at the given square using the provided magic entry. Returns ## (true, table) if successful, (false, empty) otherwise - # Initialize a new sequence with capacity 2^indexBits - result.table = newSeqOfCap[Bitboard](1 shl (64'u8 - entry.shift)) + # Initialize a new sequence with the right capacity + result.table = newSeqOfCap[Bitboard](1 shl (64'u8 - entry.shift)) # Just a fast way of doing 2 ** n result.success = true - for _ in 0..result.table.capacity: + for _ in 0..