Ah yes, because of the coming io interface I suspect.
I copied your notes to my “notes.txt” Thanks.
(writing an UCI chess engine… never done that)
var in = std.fs.File.stdin().readerStreaming(&.{});
fn Pause() void{
WriteAll("Pause\r\n");
var buf: [16]u8 = [_]u8{0} ** 16;
var c : usize = 0;
while (c <= 0) {
c = in.interface.readVec(&.{&buf}) catch unreachable;
}
}
or
fn Pause(msg : [] const u8 ) void{
Print("\nPause {s}\r\n",.{msg});
var stdin = std.fs.File.stdin();
var buf: [16]u8 = [_]u8{0} ** 16;
var c : usize = 0;
while (c == 0) {
c = stdin.read(&buf) catch unreachable;
}
}
var out: TYPE = std.fs.File.stdout().writerStreaming(&.{});
no inlining: Yes true! I gave up using that completely.
catch return, catch unreachable: Depends on the situation / usage / program.
zig fmt: That’s personal. All my files start with: zig fmt: off. It was thought by some the deck looked to cluttered.
[_]u8{0} ** 16 → @splat(0): Yes I like splat! the left statement looks crazy.
Anyway: For the 0.14 version I got it working with std.fs.File.Writer and std.fs.File.Reader.
When 0.15 is there I will have to study and rewrite.
The zig exe in the Windows terminal is a complete riddle for me (read: drama). I’ll probably start some rant inside the Explain section somewhere.
(mainly the insane slowness in not admin mode messing up my timers).