Heads or Tails?
Desktop Background
def flip(n,chance_of_one,one,two)
a = Array.new
(0..n).each do
if rand <= chance_of_one
a.push(one)
else
a.push(two)
end
end
return a
end
def flip(n,chance_of_one,one,two)
a = Array.new
(0..n).each do
if rand <= chance_of_one
a.push(one)
else
a.push(two)
end
end
return a
end