示例#1
0
        //Weather weather;
        public void Play()
        {
            bool   play;
            string playAgain;

            //Moved this to the opening screen in program.
            //weather = new Weather();
            //weather.SetRealWeatherAsync();

            while (play = true && Player.money > 0)
            {
                Console.Clear();
                DisplayTable();
                WriteText.WriteLine("");
                WriteText.WriteLine("");
                WriteText.WriteLine("");

                //Console.WriteLine("The Temperture today is {0} degrees and {1} today.", weather.Temperature, weather.WeatherEffect);
                WriteText.WriteLine($"Choose a number cooresponding to the bet you'd like to make\n" +
                                    $"1: bet on a number(1/36 odds)\t 2: Even or Odds(1/2 odds)\t 3: Red or Black(1/2 odds)\n" +
                                    $"4: Lows or Highs(1/2 odds)\t 5: Dozens(1/3 odds)\t 6: Column bet(1/3 odds)\n" +
                                    $"7: Street(1/12 odds)\t 8: six-line(1/6 odds)\t 9: Split(1/18 odds)\n" +
                                    $"10: Corner bet(1/9 odds)", ConsoleColor.Green);
                int chosenBet = Int32.Parse(Console.ReadLine());
                if (chosenBet > 10)
                {
                    throw new IndexOutOfRangeException("You chose a number that does not correspond with any of the bets.");
                }
                if (chosenBet == 1)
                {
                    Number number = new Number();
                    number.NumbersBet(Spin());
                }
                if (chosenBet == 2)
                {
                    EvenOrOdd evenorodd = new EvenOrOdd();
                    evenorodd.EvenOrOddBet(Spin());
                }
                if (chosenBet == 3)
                {
                    RedOrBlack redorblack = new RedOrBlack();
                    redorblack.RedOrBlackBet(Spin());
                }
                if (chosenBet == 4)
                {
                    LowsHighs loworhigh = new LowsHighs();
                    loworhigh.LowOrHighBet(Spin());
                }
                if (chosenBet == 5)
                {
                    Dozens dozens = new Dozens();
                    dozens.DozensBet(Spin());
                }
                if (chosenBet == 6)
                {
                    Columns columns = new Columns();
                    columns.ColumnBet(Spin());
                }
                if (chosenBet == 7)
                {
                    Street street = new Street();
                    street.StreetBet(Spin());
                }
                if (chosenBet == 8)
                {
                    SixLine sixLine = new SixLine();
                    sixLine.SixLineBet(Spin());
                }
                if (chosenBet == 9)
                {
                    Split split = new Split();
                    split.SplitBet(Spin());
                }
                if (chosenBet == 10)
                {
                    Corner corner = new Corner();
                    corner.CornerBet(Spin());
                }
                if (Player.money == 0)
                {
                    play = false;
                    WriteText.WriteLine("Thank you for playing. Good bye.", ConsoleColor.Red);
                    Console.ReadKey();
                }
                if (Player.money > 0)
                {
                    WriteText.WriteLine("Would you like to play again (yes/no): ", ConsoleColor.Red);
                    playAgain = Console.ReadLine();
                    playAgain.ToLower();
                    if (playAgain == "yes")
                    {
                        play = true;
                        Random random = new Random();
                        int    phrase = random.Next(1, 3);
                        if (phrase == 1)
                        {
                            WriteText.WriteLine("You'll certainly win more this time!", ConsoleColor.Red);
                        }
                        if (phrase == 2)
                        {
                            WriteText.WriteLine("Ah you like to live life on the edge. Fantastic lets play again!", ConsoleColor.Red);
                        }
                        if (phrase == 3)
                        {
                            WriteText.WriteLine("Luck is for the unskilled. You must be a very lucky person.", ConsoleColor.Red);
                        }
                    }
                    else if (playAgain == "no")
                    {
                        play = false;
                        WriteText.WriteLine("Thank you for playing. Good bye.", ConsoleColor.Red);
                        Console.ReadKey();
                    }
                }
            }
        }
示例#2
0
        static void Main(string[] args)
        {
            int Funds = 500;

            do
            {
Start:
                Console.WriteLine($"You have ${Funds}.");

                Console.WriteLine("Place your bet!");

                Console.WriteLine("[1 for Numbers]-[2 for Evens/Odds]-[3 for Reds/Blacks]-[4 for Lows/Highs]-[5 for Dozens]\n" +
                                  "[6 for Columns]-[7 for Street]-[8 for 6 Numbers]-[9 for Split]-[10 for Corner]-[0 to Quit]");
                string UserInput = Console.ReadLine();

                if (UserInput == "1")
                {
                    Console.WriteLine("The payout is 35:1.");
                    Numbers n = new Numbers();
                    Funds = n.NumbersBet(Funds);
                }
                if (UserInput == "2")
                {
                    Console.WriteLine("The payout is 1:1.");
                    EvensOdds e = new EvensOdds();
                    Funds = e.EvensOddsBet(Funds);
                }
                if (UserInput == "3")
                {
                    Console.WriteLine("The payout is 1:1.");
                    RedsBlacks r = new RedsBlacks();
                    Funds = r.RedsBlacksBet(Funds);
                }
                if (UserInput == "4")
                {
                    Console.WriteLine("The payout is 1:1.");
                    LowsHighs l = new LowsHighs();
                    Funds = l.LowsHighsBet(Funds);
                }
                if (UserInput == "5")
                {
                    Console.WriteLine("The payout is 2:1.");
                    Dozens d = new Dozens();
                    Funds = d.DozensBet(Funds);
                }
                if (UserInput == "6")
                {
                    Console.WriteLine("The payout is 2:1.");
                    Columns c = new Columns();
                    Funds = c.ColumnsBet(Funds);
                }
                if (UserInput == "7")
                {
                    Console.WriteLine("The payout is 11:1.");
                    Street s = new Street();
                    Funds = s.StreetBet(Funds);
                }
                if (UserInput == "8")
                {
                    Console.WriteLine("The payout is 5:1.");
                    SixNumbers s = new SixNumbers();
                    Funds = s.SixNumbersBet(Funds);
                }
                if (UserInput == "9")
                {
                    Console.WriteLine("The payout is 17:1.");
                    Split s = new Split();
                    Funds = s.SplitBet(Funds);
                }
                if (UserInput == "10")
                {
                    Console.WriteLine("The payout is 8:1.");
                    Corner c = new Corner();
                    Funds = c.CornerBet(Funds);
                }
                if (UserInput == "0")
                {
                    Console.WriteLine("Thanks for playing!");
                    Environment.Exit(0);
                }
                else
                {
                    if (Funds == 0)
                    {
                        Console.WriteLine("No money!? You don't have to go home, but you can't stay here...");
                        Environment.Exit(0);
                    }
                    goto Start;
                }
            }while (Funds >= 1);
        }