A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-126.rb
1case42
2inInteger=>nifn>100
3puts"big"
4inInteger=>nifn>10
5puts"medium: #{n}"
6end
Comparisons
Answer & explanation
Console output
medium: 42
Why
Pattern guards add a boolean condition after the pattern. Even though 42 matches `Integer => n`, the guard `n > 100` fails, so Ruby moves to the next clause. There, `n > 10` is true, so "medium: 42" is printed.