Made it on the leaderboard! Not too shabby. I solve AoC problems in Go first, and then port the solution to Zig after. The Zig section begins at 13:40. All my solutions to AoC can be found here: github.com/luk...
Пікірлер: 4
@travisstaloch36884 жыл бұрын
in zig a ternary expression can look like: `return if (expression) 0 else 1;`. you had something like `return if (expression) 0; else 1;` with an added semicolon there.
@travisstaloch36884 жыл бұрын
zig builds in debug mode by default, so you don't have to pass any compiler flags to turn it on. i was a little surprised there were no warnings for printing an undefined. i found a pretty old issue for this. github.com/ziglang/zig/issues/211 . also found out that in safe builds (debug, release-safe) zig will init undefined values to 0xaaaa... which would be 2863311530 for 32 bits. maybe that was the value you saw printed out, can't remember.
@travisstaloch36884 жыл бұрын
maybe increase the editor font size twice if you can stand to look at it