Esempio n. 1
0
        static void GamePlay()
        {
            Bets   bets = new Bets();
            Random rand = new Random();
            int    n    = rand.Next(0, 38);

            Console.Write("Rolling ball .");
            Task.Delay(1000).Wait();
            Console.Write(".");
            Task.Delay(1000).Wait();
            Console.Write(".");
            Task.Delay(1000).Wait();

            bool zeros = bets.CheckZeros(n);

            if (zeros == true)
            {
                Console.ReadLine();
                Console.ReadLine();
                return;
            }
            if (zeros == false)
            {
                Console.WriteLine($"Ball landed on : {n}");
                bets.IndividualNumberBet(n);
                bets.EvenOdd(n);
                bets.RedOrBlack(n, bets.RedNumbers, bets.BlackNumbers);
                bets.LowOrHigh(n);
                bets.Dozens(n);
                bets.Columns(n);
                bets.Street(n);
                bets.DoubleStreet(n);
                bets.Split(n);
                bets.Corner(n);
                Console.ReadLine();
            }
            Console.WriteLine("Play again? y/n [n]:");
            string answer = Console.ReadLine();

            if (answer == "y")
            {
                Console.Clear();
                GamePlay();
            }
            else
            {
                return;
            }
        }
Esempio n. 2
0
        public static void Play()
        {
            Gamble   gamble       = new Gamble();
            int      typeOfGamble = gamble.WhatKindOfBet();
            TheWheel wheel        = new TheWheel();

            int[]  ball      = wheel.Spin();
            int    whatColor = ball[0];
            int    landed    = wheel.Lands(ball);
            string color     = wheel.RedOrBlack(whatColor).ToLower();
            Bets   playerBet = new Bets();


            bool youWon;

            switch (typeOfGamble)
            {
            case 1:
                youWon = playerBet.NumbersBet(landed);
                if (youWon == true)
                {
                    Console.WriteLine("WINNER");
                }
                else
                {
                    Console.WriteLine("OH Maybe Next Time!");
                }
                break;

            case 2:
                youWon = playerBet.EvenOdd(landed);
                if (youWon == true)
                {
                    Console.WriteLine("WINNER");
                }
                else
                {
                    Console.WriteLine("OH Maybe Next Time!");
                }
                break;

            case 3:
                youWon = playerBet.ColorLandedOn(color, landed);
                if (youWon == true)
                {
                    Console.WriteLine("WINNER");
                }
                else
                {
                    Console.WriteLine("OH Maybe Next Time!");
                }
                break;

            case 4:
                youWon = playerBet.LowHigh(landed);
                if (youWon == true)
                {
                    Console.WriteLine("WINNER");
                }
                else
                {
                    Console.WriteLine("OH Maybe Next Time!");
                }
                break;

            case 5:
                youWon = playerBet.Dozens(landed);
                if (youWon == true)
                {
                    Console.WriteLine("WINNER");
                }
                else
                {
                    Console.WriteLine("OH Maybe Next Time!");
                }
                break;

            case 6:
                youWon = playerBet.Colums(landed);
                if (youWon == true)
                {
                    Console.WriteLine("WINNER");
                }
                else
                {
                    Console.WriteLine("OH Maybe Next Time!");
                }
                break;

            case 7:
                youWon = playerBet.Streets(landed);
                if (youWon == true)
                {
                    Console.WriteLine("WINNER");
                }
                else
                {
                    Console.WriteLine("OH Maybe Next Time!");
                }
                break;
            }
        }