← Back to archive

Stdle #168 · option · 2026-11-21

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 x: ?i32 = null;
if (x) |val| {
std.debug.print("{d}\n", .{val});
} else {
std.debug.print("none\n", .{});
}
}
Option
4 attempts left

Answer & explanation