<?php


$current_balance = 200;
$bet_amount = 1;

const MAX_ROUND = 500;

for($i = 0;$i<MAX_ROUND;$i++)
{
    
	$result = mt_rand()%2;
  
  

  
  	if($result == 1)
    {
      $current_balance = $current_balance+$bet_amount;
      $bet_amount = 1;      
    }
  	
  	else
    {
      $current_balance = $current_balance-$bet_amount;
      $bet_amount = $bet_amount*2;      

    }
  
        $result = $result == 1 ? 'win' : 'lose';
    	echo "result: ".$result ;
        echo " ,bet_amount :".$bet_amount;
  		echo " ,balance : ".$current_balance."\n";

  
 
  
}



# gambling