Random Binary digits in Ruby

From EggeWiki
Revision as of 19:37, 16 October 2009 by Egge (talk | contribs) (Created page with 'When I don't have [http://www.amazon.com/gp/product/0833030477?ie=UTF8&tag=eggewiki-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=0833030477 A Million Random Digits with…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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>