Skip to content

Instantly share code, notes, and snippets.

@JefClaes
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JefClaes/24f42ef7c715b579711a to your computer and use it in GitHub Desktop.
Save JefClaes/24f42ef7c715b579711a to your computer and use it in GitHub Desktop.
Playthrough Bonus II
let rec playUntilCleared ( bonus : Bonus ) settings =
match bonus.Cleared with
| true -> bonus
| false ->
(
let bet = settings.Stake
let win = settings.Stake / 100M * settings.Payout
match bonus.AcceptsBet bet with
| false -> bonus
| true -> playUntilCleared ( bonus.Bet(bet).Win(win) ) settings
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment