Skip to content

Instantly share code, notes, and snippets.

@jdjkelly
Created December 3, 2011 01:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdjkelly/1425591 to your computer and use it in GitHub Desktop.
Save jdjkelly/1425591 to your computer and use it in GitHub Desktop.
Solution for about_dice_project
class DiceSet
def initialize
dice = []
end
def roll(n)
@values = []
for i in (1..n)
@values << rand(6) + 1
end
end
def values
return @values
end
end
@jdjkelly
Copy link
Author

jdjkelly commented Dec 3, 2011

This doesn't incorporate the tests, but collision is unlikely anyways. I think it's a fairly reasonable solution to the Koan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment