← Back to archive

Stdle #115 · blocks · 2026-09-29

What does this Ruby snippet output?

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

def capture(&blk)
blk.call(10)
end
puts capture { |n| n + 5 }
Blocks
4 attempts left

Answer & explanation