diff --git a/src/main.zig b/src/main.zig index 486a233..84d0897 100644 --- a/src/main.zig +++ b/src/main.zig @@ -68,12 +68,14 @@ fn uci(str: []const u8, game: *c.game, alloc: std.mem.Allocator) uciRet { fn uciPos(str: []const u8, alloc: std.mem.Allocator) *c.game { const pos = std.mem.indexOfAny(u8, str, " \t\n\r") orelse str.len; const tok = str[0..pos]; - var game = fenGame("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", alloc); + //var game = fenGame("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", alloc); if (std.mem.eql(u8, tok, "fen")) return fenGame(str[pos..], alloc); if (std.mem.eql(u8, tok, "startpos")) { + var game = fenGame("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", alloc); game = playMoves(game, str[pos..]); + return game; } - return game; + return fenGame("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", alloc); //this should be an error } fn fenGame(str: []const u8, alloc: std.mem.Allocator) [*c]c.game {