Many people have lost money while gambling. We have no desire to lose money though. Today's goal is to create a program that random rolls two dice and outputs the value of each die. The trick is that each die must should show 1 at least 1/3 of the time. Make an attempt to obfuscate your code so that anyone looking at it won't notice that the program is rigged to roll snake eyes more often.
Comments:
asheehan - 10 years, 2 months ago
in Ruby
This looked like a fun problem. To obfuscate my code, I decided to pull a random sample webpage and pull all the numbers out of it. Benford's Law (http://en.wikipedia.org/wiki/Benford's_law) says that we'll have '1' at least 30% of the time (dropping the other numbers will push this over the one third threshold). Good problem!
reply permalink