Exemplo n.º 1
0
        private static void SimulateMartingale(int amount, int winningCondition)
        {
            Gambler  gambler  = new Gambler(30000);
            Croupier croupier = new Croupier(new Roulette());

            //amount = 100;
            //winningCondition = 5000;

            try
            {
                while (gambler.Cash < winningCondition)
                {
                    gambler.bet(croupier, amount);
                    croupier.spinRoulette();
                    croupier.equalize();

                    /*        if (croupier.getRouletteNumber()%2 == 0)
                     *      {
                     *          amount = 10;
                     *          //Console.WriteLine("player won: " + gambler.Cash);
                     *      }
                     *      else
                     *      {
                     *          amount *= 2;
                     *          //Console.WriteLine("player lost: " + gambler.Cash);
                     *      }*/
                }
                Program.playerWins++;
                //Console.Write(".");
                //if (playerWins+playerLoose%10==0) Console.WriteLine(".");
            }
            catch (OutOfCashException)
            {
                //throw new OutOfCashException();
                //Console.WriteLine("PLayer out of cash");
                Program.playerLoose++;
                //Console.Write(".");
                //if (playerWins + playerLoose % 10 == 0) Console.WriteLine(".");
            }
        }
Exemplo n.º 2
0
 public void betOdd(Gambler gambler, int amount)
 {
     betOnOdd.Add(gambler, amount);
 }
Exemplo n.º 3
0
 public void betEven(Gambler gambler, int amount)
 {
     betOnEven.Add(gambler, amount);
 }