Beispiel #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}");
        }
Beispiel #2
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();
        }