コード例 #1
0
        //RouletteTable method is the first entry point from the Program.Main method.
        //Chip values are initialized to 500, and after setting the scene the app flow is transferred to the place bet function
        //When the game is considered over, if the user chooses to play again, they will be returned here
        public static void RouletteTable()
        {
            int initialChips = 500;

            Console.WriteLine(format + "You sit down at the sole Roulette table in the large hall.");
            Console.WriteLine(format + "The ambience draws you in, you hear jazz music somewhere in the distance.");
            Console.WriteLine(format + "The dealer, a blonde man of about 23, turns to face you.");
            Console.WriteLine(format + "'Welcome! Place your bet and spin the wheel.'");
            Console.WriteLine(format + "You start with 500 Chips.");
            //"The game ends when you have 0 chips, or 1000."); **Chip check functionality coming soon!**
            Console.WriteLine(format + lineBreak);
            Console.ReadLine();
            Gamble.PlaceBet(initialChips);
        }
コード例 #2
0
        //Simple user interaction method which provides oppurtunity for returning to the PlaceBet
        //Method or gracefully exiting the application
        //Any entry other than 1 or 2 will throw an exception
        public static void SpinAgain(int chips)
        {
            Console.WriteLine(format + lineBreak);
            Console.WriteLine(format + "Would you like to spin again?");
            Console.WriteLine(format + "Press 1 for Yes and 2 for No");

            int userinput = int.Parse(Console.ReadLine());

            if (userinput == 1)
            {
                Gamble.PlaceBet(chips);
            }
            else if (userinput == 2)
            {
                return;
            }
            else
            {
                throw new ArgumentException();
            }
        }
コード例 #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to the Roulette Game!");
            Console.Clear();
            Console.WriteLine("The best part about gambling is the adrenaline rush!");
            Console.Clear();
            Console.WriteLine("Will lady luck be on your side or will you go bankrupt??");
            Console.Clear();
            Console.WriteLine("Press 'enter' to continue! ");
            Console.Clear();



            do
            {
                Gamble placegamble = new Gamble();
                placegamble.GambleMethod();
                Console.ReadLine();
                Console.Clear();
            } while (money > 0);
            Console.WriteLine("");
            Console.WriteLine("Hey bud its okay, ya win some ya lose some. Better luck next time!");
            Console.ReadLine();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: jonathan-f-gomez/Roulette
        public static void LetsPlay()
        {
            Wheel  wheel  = new Wheel();
            Gamble gamble = new Gamble();
            Bet    bet    = new Bet();

            int[]  ball      = wheel.Spin();
            int    whatColor = ball[0];
            int    land      = wheel.Lands(ball);
            string color     = wheel.RedOrBlack(whatColor).ToLower();

            int typeOfBet = gamble.YourBet();

            bool youWon;

            switch (typeOfBet)
            {
            case 1:
                youWon = bet.NumbersBet(land);
                if (youWon == true)
                {
                    Console.WriteLine("WINNER");
                }
                else
                {
                    Console.WriteLine("YAH F****N LOST");
                }
                break;

            case 2:
                youWon = bet.EvenOdd(land);
                if (youWon == true)
                {
                    Console.WriteLine("Winner");
                }
                else
                {
                    Console.WriteLine("Broke Bitch");
                }
                break;

            case 3:
                youWon = bet.ColorsBet(color);
                if (youWon == true)
                {
                    Console.WriteLine("Dan go buy another boat!");
                }
                else
                {
                    Console.WriteLine("Dan please... stop gambling");
                }
                break;

            case 4:
                youWon = bet.LowHigh(land);
                if (youWon == true)
                {
                    Console.WriteLine("Dan lives in Vegas");
                }
                else
                {
                    Console.WriteLine("Dan... please leave");
                }
                break;

            case 5:
                youWon = bet.Dozens(land);
                if (youWon == true)
                {
                    Console.WriteLine("DAN GO BUY SOME PEPSI!!");
                }
                else
                {
                    Console.WriteLine("Dan spilled his diet Pepsi");
                }
                break;
            }
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: BrendenWisnewski/Roulette
        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;
            }
        }