Created
August 14, 2018 05:39
-
-
Save ronfe/0d4c44df0691248b6c1f11363e7fa285 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
def bet(s, loss): | |
# s 是你的预算总额(单次 Cycle 能够接受的最大亏损) | |
# loss 是你已经连续多少次黑掉了 | |
# 返回你下一次投多少 | |
if loss >= 5: | |
print("别玩了") | |
return 0 | |
if s < 18: | |
print("钱不够") | |
return 0 | |
q = 1.26 | |
a_1 = s / ((1-q**5)/(1-q)) | |
return int(a_1 * q**loss) + 2 | |
# 250块钱,开档 | |
bet(250, 0) | |
# 30 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment