← Back to archive

Stdle #163 · simd · 2026-11-16

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){ 10, 20, 30, 40 };
const w = @Vector(4, i32){ 2, 2, 2, 2 };
const r = v * w;
std.debug.print("{d}\n", .{@reduce(.Add, r)});
}
SIMD
4 attempts left

Answer & explanation