Engine Yard Lucky 13 Contest

UPDATE: The contest is closed. We will be sending shirts to everyone who tweeted before this update was added 12/11/2010 @14:00 PST. You will be notified via Twitter. Thanks so much!

Attention Java and Ruby engineers: A box of snazzy new Engine Yard t-shirts just arrived at our San Francisco office. Want one? Read on puzzlers!

The Lucky 13 blog post spawned some gambling gossip. Earlier this week, eye-witness accounts reported that Charles Nutter was playing roulette with reckless abandon. Charles placed bet after bet on his lucky number 13, ignoring the odds, and his friends’ advice.

Here’s where you come in. It’s your job to explain Charlie’s payout in code. In Java, write a method that takes an argument for the size of his bet. Call the Engine Yard Roulette Wheel, which returns the winning number (okay, it’s actually a string). Return Charlie’s payout based on a winning Lucky 13. Use as few lines of code as you can.

Ruby readers: same problem. Ruby. Go!

To qualify for a snazzy new Engine Yard shirt, you must:

  1. Post your code using [http://gist.github.com](http://gist.github.com).
  2. Send a Tweet with two items: A) Your gist, B) #engineyard
We will post the most interesting, or elegant solutions next week.