Guest User

Prime Dice Simulator 2014

a guest
May 13th, 2014
441
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.30 KB | None | 0 0
  1. import random
  2. ## starting balance in BTC
  3. bal = 0.02277
  4. hbal = 0
  5. ## base bet in BTC
  6. sbet = 0.0000005
  7. bet = sbet
  8. ## multiplier on win
  9. mult = 1.32
  10. ## increase percent on loss: 15% is 1.15, 100% is 2, 0% is 1
  11. inc = 5
  12. ##less than: enter the number you have to roll *LESS THAN* to win. move decimal
  13. ##2 places to the right. example: less than 10 is less 1000 for this, 6.60 = 660
  14. less = 7500
  15. ## stop when balance is: if set to 1, stops if you get to 1 BTC
  16. stop = 1
  17. count = 0
  18. while (bal - bet >= 0) and (bal < stop):
  19.     print "Balance: ",bal
  20.     print "Bet: ",bet
  21.     roll = random.randint(0, 10000)
  22.     print "Roll: ",roll
  23.    
  24.     if bal > bet:
  25.         if roll > less:
  26.             bal = bal - bet
  27.             count = count + 1
  28.             bet = round(bet*inc, 8)
  29.         else:
  30.             profit = 0
  31.             profit = bet * mult
  32.             bal = bal + profit
  33.             bet = sbet
  34.             count = count + 1
  35.             ## displayed way out to the right for better visibility
  36.             print "Profit:                  ",profit
  37.              
  38.     print "Count: ",count
  39.     print ""
  40.     if bal > hbal:
  41.         hbal = bal
  42. print "Final Balance: ",bal
  43. print "Total Number of Bets:", count
  44. if bal >= stop:
  45.     print "Win"
  46. else:
  47.     print "Lose"
  48.     print "Highest Balance: ",hbal
Advertisement
Add Comment
Please, Sign In to add comment