I hereby claim:
- I am thesoftwarejedi on github.
- I am danahanna (https://keybase.io/danahanna) on keybase.
- I have a public key ASAOXyOhEHk9yFjNU0yxnBIiPw0FalzwxVVQqm6QOtuQIAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import requests | |
import json | |
import calendar | |
from datetime import datetime, timedelta | |
#token from https://api.slack.com/web | |
_token = "YOUR TOKEN HERE" | |
_domain = "YOUR SUB DOMAIN HERE" | |
if __name__ == '__main__': |
You bet using the Martingale strategy: | |
Whenever you lose a bet, you double the value of the bet for the next round. | |
Whenever you win, the bet for the next round will be one dollar. You start the round by betting one dollar. | |
For example, if you start with 20 dollars, and you win the bet in the first round, lose the bet in the next two rounds and then win the bet in the fourth round, you will end up with 20+1-1-2+4 = 22 dollars. | |
Write a function "go", which takes two arguments: | |
The 1st argument: integer - the initial money we amount we have when we start the betting. |
q.Aggregate(new{b=1,c=w,x=1},(l,o)=>l.x<0?l:o=='W'?new{b=1,c=l.c+l.b,x=1}:new{b=l.b*2,c=l.c-l.b,x=(l.c-l.b)-(l.b*2)}).c; |