All pastes #364435 Raw Edit

Untitled

public text v1 · immutable
#364435 ·published 2007-02-20 04:15 UTC
rendered paste body

#!/usr/bin/ruby

class Die
        def initialize(sides)
                @sides = sides
        end

        def roll()
                return (rand() * @sides).floor + 1
        end
end

srand()
current = Die.new(6)
puts current.roll()