Skip to content

Instantly share code, notes, and snippets.

@steveklabnik
Created December 5, 2011 03:23
Embed
What would you like to do?
Bowling game frames
def frames
Enumerator.new do |yielder|
position = 0
10.times do
yielder << rolls[position,3].map(&:to_i)
if rolls[position] == 10
position += 1
else
position += 2
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment