← Back to archive

Stdle #171 · slices · 2026-11-24

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 {
var arr = [_]u8{ 1, 2, 3, 4, 5 };
const s = arr[1..4];
std.debug.print("{d}\n", .{s[s.len - 1]});
}
Slices
4 attempts left

Answer & explanation