← Back to archive

Stdle #153 · control · 2026-11-06

What does this Zig snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

const std = @import("std");
pub fn main() void {
const ch: u8 = 'z';
const result = switch (ch) {
'a'...'z' => "lower",
'A'...'Z' => "upper",
else => "other",
};
std.debug.print("{s}\n", .{result});
}
Control Flow
4 attempts left

Answer & explanation