A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-179.zig
1conststd=@import("std");
2pubfnmain()void{
3varx:u8=250;
4x+%=10;
5std.debug.print("{d}\n",.{x});
6}
Integers
Answer & explanation
Console output
4
Why
Zig’s `+%` is the explicit wrapping add. A `u8` is 8 bits (0..255), so 250 + 10 = 260 wraps modulo 256 to 4. Plain `+` would be a checked overflow (a compile error or a runtime panic in safe builds). Zig forces you to opt into wrapping with `%`.