~macaptain/lkdo-chess

ref: 0bf3bc692f7cf1486a36d984db92c580feb6634c lkdo-chess/src/main.zig -rw-r--r-- 903 bytes
0bf3bc69Michael Captain Add pawn attack tables and tests 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const std = @import("std");
const board = @import("board.zig");
const attack = @import("attack.zig");

const VERSION = "0.0.1";

fn uciLoop() !void {
    const stdin = std.io.getStdIn().reader();
    const stdout = std.io.getStdOut().writer();
    var line_buf: [2000]u8 = undefined;
    while (true) {
        const uci_in = (try stdin.readUntilDelimiterOrEof(line_buf[0..], '\n'));
        if (uci_in == null) {
            return;
        } else if (std.mem.eql(u8, uci_in.?, "uci")) {
            try stdout.print("id name LKDO v{s}\n", .{VERSION});
            try stdout.print("id author macaptain\n", .{});
            try stdout.print("uciok\n", .{});
        } else if (std.mem.eql(u8, uci_in.?, "quit")) {
            return;
        } else if (std.mem.eql(u8, uci_in.?, "isready")) {
            try stdout.print("readyok\n", .{});
        }
    }
}

pub fn main() !void {
    //uciLoop();
}