← Back to archive

Stdle #103 · simd · 2026-09-17

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 v: @Vector(4, i32) = .{ 1, 2, 3, 4 };
const w: @Vector(4, i32) = .{ 10, 20, 30, 40 };
const sum = v + w;
std.debug.print("{d}\n", .{sum[0]});
std.debug.print("{d}\n", .{sum[3]});
}
SIMD
2 lines
4 attempts left

Answer & explanation