Skip to content

Instantly share code, notes, and snippets.

@thisiswei
Last active December 18, 2015 10:49
Show Gist options
  • Save thisiswei/5771180 to your computer and use it in GitHub Desktop.
Save thisiswei/5771180 to your computer and use it in GitHub Desktop.
(define (getFinalAmount initial res)
(define (helper total bet n)
(cond [(or (> (+ 1 n) (string-length res)) (> bet total)) total]
[(eq? (string-ref res n) #\L) (helper (- total bet) (* 2 bet) (+ n 1))]
[#t (helper (+ amount total) 1 (+ n 1))]))
(helper initial 1 0))
@thisiswei
Copy link
Author

racket, WTF??
nut python can only recursive 1000 time.
FUck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment