Skip to content

Instantly share code, notes, and snippets.

@andrewhl
Forked from rickhull/diceroll.rb
Created October 11, 2011 20:36
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 andrewhl/1279355 to your computer and use it in GitHub Desktop.
Save andrewhl/1279355 to your computer and use it in GitHub Desktop.
Ruby Koan
module DiceSet
def self.roll(num)
Array.new(num) { 1 + rand(6) }
end
end
DiceSet.roll(20)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment