Skip to content

Instantly share code, notes, and snippets.

@steveklabnik
Created December 5, 2011 03:23
Show Gist options
  • Select an option

  • Save steveklabnik/1432166 to your computer and use it in GitHub Desktop.

Select an option

Save steveklabnik/1432166 to your computer and use it in GitHub Desktop.
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