Random Boolean

Submitted By:
znz

Difficulty:
Easy

Tags:
rand, booleans

Instructions:
Return random booleans.

Code:
def random_boolean
  ___
end

array = []

100.times do
  if random_boolean
    array << :dummy
  end
end

assert_equal (1..100) === array.size, true
assert_equal array.size != 100, true

Your Solution

Ruby 1.9.3

Back to Problems