Last active
December 18, 2015 10:49
-
-
Save thisiswei/5771180 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
racket, WTF??
nut python can only recursive 1000 time.
FUck.