Skip to content

Instantly share code, notes, and snippets.

@pjlowry
Created January 30, 2013 19:30
Show Gist options
  • Save pjlowry/4676004 to your computer and use it in GitHub Desktop.
Save pjlowry/4676004 to your computer and use it in GitHub Desktop.
roll it out
class Die
attr_accessor :sides
def initialize(number)
@number = number
end
def roll
rand(1..@number)
end
end
dice = Die.new(6)
puts dice.roll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment