Skip to content

Instantly share code, notes, and snippets.

@willbailey
Created December 10, 2010 05:05
Show Gist options
  • Save willbailey/735813 to your computer and use it in GitHub Desktop.
Save willbailey/735813 to your computer and use it in GitHub Desktop.
lucky 13
require "open-uri"
def bet(bet)
win = false; winnings = 0
until win
win = open("http://roulette.engineyard.com").read.match(/13/)
winnings += (win ? bet * 35 : -bet)
end
winnings
end
puts "total winnings: #{bet 5}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment