Programming languages make it super easy to pick a random number. A call to a built-in 'generate random number' function returns some float value between 0 and 1.0 and really the only heavy lifting for the developer is to turn that into a bigger number, a boolean (yes/no), or whatever. Ta-da. It does exactly as it says on the tin.
So, naturally, in a contest like ours, if a developer can think outside of the box and deliver a truly novel way of choosing a random result, he or she deserves a tip of the hat, or as we like to call it, the “Casino Royale, with Cheese” award.
Out of all the entries received, there were many different variations on the theme, but in our eyes, the best was Sloothword’s entry: The Random Decision Making Engine Generator (or RDTG for short…making it the Random Decision Thing Generator? Right?!)
Admittedly, the winner that we announced yesterday for the Lipstick on a Pig prize (the best UI), had a fantastic method of randomness using Google Translate, but the RDTG application simply goes above and beyond. After all, why choose only a single method of calculating a random decision when you can use ALL of them.
I mean, just look at all your options. It’s like a random decision buffet!
The picture doesn’t do the app true justice. Here’s a list of what comes standard out of the box:- Coin Flip – Flips a coin.
- TDWTF character count – Is the character count of thedailywtf.com even?
- Post count – Is the combined count of morbs and snoofle on TDWTF forums even?
- NewRelic – Is the number of NewRelic’s daily collected metrics even?
- WebcamColor Palette – Are there more red-ish pixels or blue-ish pixels on your webcam?
- Return sum of numbers 1 to 5 with explicit node parameter naming
- Return sum of numbers 1 to 5 with automatic node parameter naming
- Return sum of numbers 1 to 5 in different order
- Return sum of numbers 1 to 5 in another order
- Return sum of numbers 1 to 5 with templates
- Rock Paper Scissors
- Rock Paper Scissors Lizard Spock – As seen on TV
- Roll Dice
- Really TDWTF? – Checks whether there was a new post today
- Algebra – For Laplacian random Boolean sources a,b, and c, outputs percentage of being true. Guess the result!
- 1+1=? – Returns 2 (hopefully)
- What should I read? – Returns a random Wikipedia article name.
- How many results can be found for the search term “Random”
- What is the first link found after googling for TDWTF
- What is the 13th image found after googling for WTF
- Get percentage of bright pixels on the screen
- Count Black Pixels of Dummy Image
That’s nearly two dozen ways of reaching a decision. Now, I can think of a ton of reasons why some of these are good for decision making but horrible in other ways (such as I especially disagree with #14 since we DID in fact publish yesterday!), but it’s the flaws like this that made us love this entry even more! Ok, so, behind the scenes…how does it all work? What is the code like? Well, the way that Sloothword explains it, the back story is that in a corporation far away, some manager wants a fast and human readable solution. Since tree structures are fast, it’s 100% the way to go and naturally, saving information about the decision process as ASCII trees that look like the following, is a perfect marriage.
// Simple everyday decisions [RPS] Decision: Rock Paper Scissors Description: Decide the next RockPaperScissors move. Select |-- Rock,Paper,Scissors `-- BitSetter |-- RandomBoolean |-- RandomBoolean |-- RandomBoolean `-- RandomBoolean [RPSLS] Decision: Rock Paper Scissors Lizard Spock Description: As seen on TV (TBBT) Select |-- Rock,Paper,Scissors,Lizard,Spock `-- BitSetter |-- RandomBoolean |-- RandomBoolean |-- RandomBoolean `-- RandomBoolean [DiceRoll] Decision: Dice Description: Rolls a dice. Select |-- One,Two,Three,Four,Five,Six,Seven `-- Multiplication |-- 6 `-- RandomFloat [ReallyTDWTF] Decision: Really TDWTF? Description: Checks whether there was a new post today. If |-- The-Daily-WTF,The-Not-So-Daily-WTF `-- StringEqual |-- String1: DOMSelector | |-- Selector: .Date | `-- URL: ParseURL | `-- "https://thedailywtf.com/" `-- String2: DateParser `-- OutputFormat: yyyy-MM-dd [BooleanAlgebra] Decision: Algebra Description: For Laplacian random boolean sources a, b, and c, outputs the percentage of ((a AND b) OR c) being true. Guess the result! Iterator |-- Iterations: 1000000 `-- Expression: Or |-- Operand1: RandomBoolean `-- Operand2: And |-- Operand1: RandomBoolean `-- Operand2: RandomBoolean {Increment} Addition |-- Operand1: 1 `-- Operand2: [Operand] [IncrementTest] Decision: 1+1=? Description: Returns 2 (hopefully) Subtraction |-- Operand1: {Increment} | `-- Operand: 1 `-- Operand2: 0 [RandomArticle] Decision: What should i read? Description: Returns a random wikipedia article name DOMSelector |-- ParseURL | `-- "https://en.wikipedia.org/wiki/Special:Random" `-- "#firstHeading span"
The rest of the code isn’t much of a picnic. According to the submission’s backstory, the Intern author also neglected to add any “exception handling whatsoever (silent crashes) - Cludgy GUI - The ASCII tree parser is (not surprising) a complete mess - Immense code duplication - Many strings contain magic marker or character[s].”
In the end, we found that Sloothword provided what we believe to be the very best method of delivering a random decision to the user earning him the “Casino Royale, with Cheese” award. His entry also combined several elements of the other winning entries - pleasing UI, funky use of ASCII trees, and the meta-ness is indeed clever - making this award a logical and well-earned second place.