← Back to archive

Stdle #149 · errors · 2026-11-02

What does this Zig snippet output?

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

const std = @import("std");
fn parse(b: bool) !i32 {
if (b) return error.Bad;
return 7;
}
pub fn main() !void {
const v = try parse(false);
std.debug.print("{d}\n", .{v});
}
Errors
4 attempts left

Answer & explanation