Beispiel #1
0
        static void Main(string[] args)
        {
            var   bet = new BetService();
            float odd = 0;

            for (int i = 0; i < 10; i++)
            {
                odd = bet.GetOdds();
            }
            Console.WriteLine($"I've bet 100 USD with the odd {odd} and I've earned {bet.Bet(100)}");

            for (int i = 1; i <= 3;)
            {
                if ((odd = bet.GetOdds()) > 12)
                {
                    Console.WriteLine($"I've bet 100 USD with the odd {odd} and I've earned {bet.Bet(100)}");
                    i++;
                }
            }

            var allAmount = 10000m;

            while (allAmount > 0 && allAmount < 15000)
            {
                if (bet.GetOdds() < 1.5f)
                {
                    var amount = allAmount < 1000 ? allAmount : 1000;
                    allAmount -= amount;
                    allAmount += bet.Bet(amount);
                }
            }
            Console.WriteLine($"Game over. My balance is {allAmount}");
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            BetService betService = new BetService();

            for (int i = 0; i < 100; i++)
            {
                Console.WriteLine("I’ve bet 100 USD with the odd {0} and I’ve earned {1}", betService.GetOdds(), betService.Bet(100));
            }
            Console.WriteLine();

            int j = 0;

            while (j != 3)
            {
                float odd = betService.GetOdds();
                if (odd > 12)
                {
                    Console.WriteLine("I’ve bet 100 USD with the odd {0} and I’ve earned {1}", odd, betService.Bet(100));
                    j++;
                }
            }
            Console.WriteLine();

            decimal amount = 10_000;

            while (true)
            {
                if ((amount <= 0) || (amount >= 15_000))
                {
                    Console.WriteLine("Game over. My balance is {0}", amount);
                    break;
                }
                if (betService.GetOdds() <= 1.09)
                {
                    if (amount < 1000)
                    {
                        decimal bet = amount;
                        amount  = 0;
                        amount += (decimal)betService.Bet(bet);
                    }
                    else
                    {
                        decimal bet = amount / 10;
                        amount -= bet;
                        amount += (decimal)betService.Bet(bet);
                    }
                    Console.WriteLine(amount);
                }
            }
        }
Beispiel #3
0
        //i looked for at least some balance
        static void BetWhileWinLose()
        {
            decimal    amount     = 10000;
            BetService betService = new BetService();

            while (amount > 0 && amount < 150000)
            {
                float odd = betService.GetOdds();
                if (odd > 21 && odd < 25)
                {
                    amount -= 2000;
                    amount += betService.Bet(2000);
                    Console.WriteLine(amount);
                }
                else
                {
                    continue;
                }
            }
            Console.WriteLine($"Game over. My balance is {amount}");
        }
        static void Main(string[] args)
        {
            BetService betService = new BetService();

            Console.WriteLine(betService.IsWon());
        }