fixed fenGame loading backwords

This commit is contained in:
k 2025-10-21 19:49:22 -04:00
parent 1d41b76fa8
commit ded1566f53

View File

@ -60,7 +60,7 @@ fn uciPos(str: []const u8, alloc: std.mem.Allocator) *types.game {
}
fn fenGame(str: []const u8, alloc: std.mem.Allocator) *types.game {
var pos: u8 = 0;
var pos: u8 = 63;
var space: u8 = 0;
var g = alloc.create(types.game) catch unreachable;
g.* = std.mem.zeroes(types.game);
@ -84,7 +84,7 @@ fn fenGame(str: []const u8, alloc: std.mem.Allocator) *types.game {
const set: *u64 = mov.charToSet(g, chr);
const bit: u64 = @as(u64, 1) << @truncate(pos);
set.* |= bit;
pos += 1;
pos -= 1;
}
return g;
}