← Back to archive

Stdle #143 · comparisons · 2026-10-27

What does this Ruby snippet output?

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

val = "hello"
case val
when Integer
puts "int"
when String
puts "str"
when Symbol
puts "sym"
end
Comparisons
4 attempts left

Answer & explanation