← Back to archive

Stdle #160 · option · 2026-11-13

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 val: ?u32 = null;
const result = val orelse 42;
std.debug.print("{d}\n", .{result});
}
Option
4 attempts left

Answer & explanation