Exemplo n.º 1
0
        public static void NumbersBets()

        {
            Console.WriteLine("Pick a number to bet on between 0 and 36, including 00.");
            int           bet      = int.Parse(Console.ReadLine());
            int           num      = 0;
            RouletteWheel roulette = new RouletteWheel(new Random());

            for (int i = 0; i < 1; i++)
            {
                int    slot  = roulette.RandomSlot();
                Color  color = RouletteWheel.SlotColor(slot);
                string text  = RouletteWheel.SlotText(slot);
                Console.WriteLine("{0} {1}", text, color);
                num = int.Parse(text);
            }

            if (bet != num)
            {
                Console.WriteLine("You lose!");
            }
            else
            {
                Console.WriteLine("You win!");
            }

            Console.WriteLine($"Your bet was {bet}.  The winning number was {num}");
        }
Exemplo n.º 2
0
        static void EvensOdds()
        {
            Console.WriteLine("Input 1 for odd and 2 for even.");
            int bet = int.Parse(Console.ReadLine());

            do
            {
                if (bet == 1)
                {
                    Console.WriteLine("You chose odd.");
                    break;
                }
                else if (bet == 2)
                {
                    Console.WriteLine("You chose even.");
                    break;
                }
                else
                {
                    Console.WriteLine("Please input a correct number for your color choice, 1 for red, 2 for black");
                    bet = int.Parse(Console.ReadLine());
                }
            } while (bet < 1 && bet > 2);

            int           num      = 0;
            RouletteWheel roulette = new RouletteWheel(new Random());

            for (int i = 0; i < 1; i++)
            {
                int   slot  = roulette.RandomSlot();
                Color color = RouletteWheel.SlotColor(slot);
                num = slot % 2;

                if (IsEven(num))
                {
                    Console.WriteLine("The winning number is even.");
                    num = 2;
                }
                else
                {
                    num = 1;
                }
            }

            if (bet != num)
            {
                Console.WriteLine("You lose!");
            }
            else
            {
                Console.WriteLine("You win!");
            }
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            RouletteWheel roulette = new RouletteWheel(new Random());

            for (int i = 0; i < 1; i++)
            {
                int    slot  = roulette.RandomSlot();
                Color  color = RouletteWheel.SlotColor(slot);
                string text  = RouletteWheel.SlotText(slot);
                Console.WriteLine("{0} {1}", text, color);
            }

            PlaceABet();
        }
Exemplo n.º 4
0
        static void LowsHighs()
        {
            Console.WriteLine("Input 1 for lows (1 - 18), 2 for highs (19 - 36).");
            int           bet = int.Parse(Console.ReadLine());
            RouletteWheel rw  = new RouletteWheel(new Random());
            int           num = 0;

            for (int i = 0; i < 1; i++)
            {
                int   slot  = rw.RandomSlot();
                Color color = RouletteWheel.SlotColor(slot);
                num = slot;
            }

            if (num >= 1 && num <= 18)
            {
                Console.WriteLine("The ball landed on a low number.");
                num = 1;
            }

            else if (num >= 19 && num <= 37)
            {
                Console.WriteLine("The ball landed on a high number.");
                num = 2;
            }

            if (bet == 1)
            {
                Console.WriteLine("You made a low bet.");
                bet = 1;
            }

            else if (bet == 2)
            {
                Console.WriteLine("You made a high bet.");
            }

            if (num == bet)
            {
                Console.WriteLine("You bet correctly, you win!");
            }
            else
            {
                Console.WriteLine("You lose.");
            }
        }