← Back to archive

Stdle #64 · comparisons · 2026-08-09

What does this Rust snippet output?

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

fn main() {
let n = 0u8;
let s = match n {
0 => "false",
1 => "true",
_ => "invalid",
};
println!("{}", s);
}
Comparisons
4 attempts left

Answer & explanation