class Integer

Integer extensions for graphics

Public Instance Methods

=~(n) click to toggle source
Calculate a random chance using easy notation: 1 =~ 50

1 in 50 chance

# File lib/graphics/extensions.rb, line 8
def =~ n #
  rand(n) <= (self - 1)
end