Ejemplo n.º 1
0
        public void ChooseBet(string menu)
        {
            try
            {
                switch (menu)  //switch statement so the user can choose which bet they would like to do
                {
                case "1":
                    //Straight number bet
                    Console.WriteLine("What number to you want to bet on? ");
                    Console.Write(":>");
                    NumCheck();
                    Bet();
                    int    resultI = wa.GetBallLocation(wa.wheelAll); //the get location method for where the ball falls in reference to the indexing of the wheel all array
                    string resultC = wa.GetBallColor(wa.color);       //return the color method based off the color array

                    Console.WriteLine($"The ball landed in {resultC} {resultI}.");
                    Number();
                    Console.ReadLine();
                    break;

                case "2":
                    //Even or odd bet
                    Console.WriteLine("1. Evens | 2. Odds?");
                    Console.Write(":>");
                    int evenOdd = Convert.ToInt32(Console.ReadLine());
                    Bet();
                    resultI = wa.GetBallLocation(wa.wheelAll);
                    resultC = wa.GetBallColor(wa.color);

                    Console.WriteLine($"The ball landed in {resultC} {resultI}.");
                    EvenOdd(evenOdd);
                    Console.ReadLine();
                    break;

                case "3":
                    //red or black bet
                    Console.WriteLine("1.Reds | 2. Blacks");
                    Console.Write(":>");
                    int choice = Convert.ToInt32(Console.ReadLine());
                    Bet();
                    resultI = wa.GetBallLocation(wa.wheelAll);
                    resultC = wa.GetBallColor(wa.color);
                    //   ws.Spin();
                    Console.WriteLine($"The ball landed in {resultC} {resultI}.");
                    RedBlack(choice, resultC);
                    Console.ReadLine();
                    break;

                case "4":
                    //low or high bet
                    Console.WriteLine("1. Lows | 2. Highs");
                    Console.Write(":>");
                    choice = Convert.ToInt32(Console.ReadLine());
                    Bet();
                    resultI = wa.GetBallLocation(wa.wheelAll);
                    resultC = wa.GetBallColor(wa.color);
                    //  ws.Spin();
                    Console.WriteLine($"The ball landed in {resultC} {resultI}.");
                    LowHigh(choice);
                    Console.ReadLine();
                    break;

                case "5":
                    //dozen bet
                    Console.WriteLine("Which Dozen?\n1. 1 - 12 | 2. 13 - 24 | 3. 25 - 36");
                    Console.Write(":>");
                    choice = Convert.ToInt32(Console.ReadLine());
                    Bet();
                    resultI = wa.GetBallLocation(wa.wheelAll);
                    resultC = wa.GetBallColor(wa.color);
                    //  ws.Spin();
                    Console.WriteLine($"The ball landed in {resultC} {resultI}.");
                    Dozen(choice);
                    Console.ReadLine();
                    break;

                case "6":
                    //column bet
                    Console.WriteLine("Which Column?\n1. | 2. | 3. ");
                    Console.Write(":>");
                    choice = Convert.ToInt32(Console.ReadLine());
                    Bet();
                    resultI = wa.GetBallLocation(wa.wheelAll);
                    resultC = wa.GetBallColor(wa.color);
                    //  ws.Spin();
                    Console.WriteLine($"The ball landed in {resultC} {resultI}.");
                    Column(choice);
                    Console.ReadLine();
                    break;

                case "7":
                    //street bet
                    Console.WriteLine("Which Street?\n1 - 12");
                    Console.Write(":>");
                    choice = Convert.ToInt32(Console.ReadLine());
                    Bet();
                    resultI = wa.GetBallLocation(wa.wheelAll);
                    resultC = wa.GetBallColor(wa.color);
                    //  ws.Spin();
                    Console.WriteLine($"The ball landed in {resultC} {resultI}.");
                    Street(choice);
                    Console.ReadLine();
                    break;

                case "8":
                    //6's bet
                    Console.WriteLine("Which 6?\n1 - 6");
                    Console.Write(":>");
                    choice = Convert.ToInt32(Console.ReadLine());
                    Bet();
                    resultI = wa.GetBallLocation(wa.wheelAll);
                    resultC = wa.GetBallColor(wa.color);
                    //   ws.Spin();
                    Console.WriteLine($"The ball landed in {resultC} {resultI}.");
                    Double6(choice);
                    Console.ReadLine();
                    break;

                case "9":
                    //split bet, how the betting table is set up, each number is either +1, -1, +4, or -4
                    //away from the user's first bet, so this checks for that condition before the bet is valid
                    Console.WriteLine("Enter your first number, then press enter:");
                    Console.Write(":>");
                    int choicea, choiceb;
                    choicea = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("Enter your second number, then press enter:");
                    Console.Write(":>");
                    do
                    {
                        choiceb = Convert.ToInt32(Console.ReadLine());
                    } while (choicea != choiceb + 1 && choicea != choiceb - 1 && choicea != choiceb + 3 && choicea != choiceb - 3);
                    Bet();
                    resultI = wa.GetBallLocation(wa.wheelAll);
                    resultC = wa.GetBallColor(wa.color);
                    //  ws.Spin();
                    Console.WriteLine($"The ball landed in {resultC} {resultI}.");
                    Split(choicea, choiceb);
                    Console.ReadLine();
                    break;

                case "10":
                    //corner bet, this asks for the smallest value in the user's bet, the bet cannot be divisible by 3
                    Console.WriteLine("What is the lowest value in your corner bet?");
                    int corner;
                    do
                    {
                        Console.Write(":>");
                        corner = Convert.ToInt32(Console.ReadLine());
                    } while (corner < 1 && corner > 36);
                    Bet();
                    resultI = wa.GetBallLocation(wa.wheelAll);
                    resultC = wa.GetBallColor(wa.color);
                    //  ws.Spin();
                    Console.WriteLine($"The ball landed in {resultC} {resultI}.");
                    Corner(corner);
                    Console.ReadLine();
                    break;
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                Console.ReadLine();
            }
        }