jhylands

Rulet wheel stratagy simulator

May 11th, 2017
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. for(var n=0;n<1000;n++){
  2. total=0;
  3. for (var i=0;i<1000;i++){
  4.     //bet is taken
  5.     total -=lbet + greenBet;
  6.     s = spin();
  7.     winq = win(s);
  8.     //if won recive winnings
  9.     total += 2*lbet*winq;
  10.     //recive insurance winnings
  11.     total +=greenBet*s*36==0;
  12.     lbet = betV(lbet,winq);
  13.    
  14.     if(lbet%64==0){
  15.         greenBet=lbet/64;
  16.     }else{
  17.         greenBet=0;
  18.     }
  19.     //console.log(total);
  20. }
  21. data[n]=total;
  22. }
  23. function betV(lbet,lw){return Math.min(lbet*2*!lw + lw,Math.pow(2,20));}
Advertisement
Add Comment
Please, Sign In to add comment