top | dibdib: Random things | programming: Ruby  /  EDF  /  Palm  /  Perl | obsessions: Games | about: me  /  my pages  /  people

ruby programming

[download this file]

newbets.rb

Hacky script that works out my returns on gambling. To work out how much I won on a patent (3 bets giving 7 winning lines) where the first two came in, I call the script like this:

> ruby newbets.rb 1 +13/5 +8/1 20/1
Stake=1.0
Bet 1 won at 13/5
Bet 2 won at 8/1
Winnings are 45.00

The syntax is newbets.rb stake_per_line odds [odds...] where winning odds are prefixed with a '+'.

The only special bet it knows about is the Goliath where you don't get the singles included in your 247 winning lines.