Skip to content

Instantly share code, notes, and snippets.

@ronfe
Created August 14, 2018 05:39
Show Gist options
  • Save ronfe/0d4c44df0691248b6c1f11363e7fa285 to your computer and use it in GitHub Desktop.
Save ronfe/0d4c44df0691248b6c1f11363e7fa285 to your computer and use it in GitHub Desktop.
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