← Back to archive

Stdle #27 · option · 2026-07-03

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 a: ?u32 = 10;
const b: u32 = a orelse 99;
std.debug.print("{d}\n", .{b});
const c: ?u32 = null;
const d: u32 = c orelse 99;
std.debug.print("{d}\n", .{d});
}
Option
2 lines
4 attempts left

Answer & explanation