Method: Integer#=~

Defined in:
lib/graphics/extensions.rb

#=~(n) ⇒ Object

Calculate a random chance using easy notation: 1 =~ 50

1 in 50 chance



8
9
10
# File 'lib/graphics/extensions.rb', line 8

def =~ n #
  rand(n) <= (self - 1)
end