Random Binary digits in Ruby

From EggeWiki

When I don't have A Million Random Digits with 100,000 Normal Deviates handy, I tend to code a quick ruby script instead.

<geshi lang="ruby"> ruby -e '(0..1000000).each {|x| print(rand(2) % 2) }; puts ' </geshi>