}//works public void IsEvenOddsWin(SpinWheel spinWheel, EvenOrOdd evenOrOddBet, Board[,] rouletteBoard) { if (evenOrOddBet.evenOrOdd == true && (rouletteBoard[spinWheel.winningColumn, spinWheel.winningRow].number % 2 == 0)) { Console.WriteLine("Your Even Bet won"); } else if (evenOrOddBet.evenOrOdd == false && (rouletteBoard[spinWheel.winningColumn, spinWheel.winningRow].number % 2 != 0)) { Console.WriteLine("Your odd bet won"); } else { Console.WriteLine("Your bet did not win"); } }
//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(); } } } }
static void Main(string[] args) { var rouletteBoard = CreateBoard(); Random rng = new Random(); GetBet getBet = new GetBet(); SpecificNumberBet specificNumberBet = new SpecificNumberBet(); EvenOrOdd evenOrOddBet = new EvenOrOdd(); ColorBet colorBet = new ColorBet(); LowHigh lowHighBet = new LowHigh(); Dozen dozenBet = new Dozen(); Columns columnBet = new Columns(); Rows rowBet = new Rows(); DoubleRows doubleRowBet = new DoubleRows(); Split splitBet = new Split(); Corner cornerBet = new Corner(); SpinWheel spinWheel = new SpinWheel(rng); DetermineWin determineWin = new DetermineWin(); DisplayPossibleWinningBets displayPossibleWinningBets = new DisplayPossibleWinningBets(); DisplayWinningBin displayWinningBin = new DisplayWinningBin(); int categoryChoice; //for (int i = 0; i < 100; i++) //{ // doubleRowBet.row1= 1; // doubleRowBet.row2 = 2; // spinWheel.Spin(); // displayWinningBin.DisplayResult(spinWheel, rouletteBoard); // determineWin.IsDoubleRowsWin(spinWheel, doubleRowBet); // Console.ReadLine(); // Console.Clear(); //} do { DisplayBoard(rouletteBoard); getBet.DisplayPossibleBets(); categoryChoice = getBet.GetBetCategoryChoice(); switch (categoryChoice) { case 0: { break; } case 1: { specificNumberBet.numberBettingOn = getBet.GetNumberBet(); spinWheel.Spin(); displayWinningBin.DisplayResult(spinWheel, rouletteBoard); determineWin.IsSpecificNumberWin(spinWheel, specificNumberBet, rouletteBoard); displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard); break; } case 2: { colorBet.colorBettingOn = getBet.GetColorBet(); spinWheel.Spin(); displayWinningBin.DisplayResult(spinWheel, rouletteBoard); determineWin.IsRedBlackWin(spinWheel, colorBet, rouletteBoard); displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard); break; } case 3: { evenOrOddBet.evenOrOdd = getBet.EvensOdds(); spinWheel.Spin(); displayWinningBin.DisplayResult(spinWheel, rouletteBoard); determineWin.IsEvenOddsWin(spinWheel, evenOrOddBet, rouletteBoard); displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard); break; } case 4: { lowHighBet.high = getBet.LowHighBet(); spinWheel.Spin(); displayWinningBin.DisplayResult(spinWheel, rouletteBoard); determineWin.IsLowHighWin(spinWheel, lowHighBet, rouletteBoard); displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard); break; } case 5: { dozenBet.dozen = getBet.DozensBet(); spinWheel.Spin(); displayWinningBin.DisplayResult(spinWheel, rouletteBoard); determineWin.IsDozensWin(spinWheel, rouletteBoard, dozenBet); displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard); break; } case 6: { columnBet.column = getBet.ColumnBet(); spinWheel.Spin(); displayWinningBin.DisplayResult(spinWheel, rouletteBoard); determineWin.IsColumnsWin(spinWheel, columnBet); displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard); break; } case 7: { rowBet.row = getBet.RowBet(); spinWheel.Spin(); displayWinningBin.DisplayResult(spinWheel, rouletteBoard); determineWin.IsRowWin(spinWheel, rowBet); displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard); break; } case 8: { getBet.DoubleRowBet(doubleRowBet); spinWheel.Spin(); displayWinningBin.DisplayResult(spinWheel, rouletteBoard); determineWin.IsDoubleRowsWin(spinWheel, doubleRowBet); displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard); break; } case 9: { getBet.SplitBet(splitBet); spinWheel.Spin(); displayWinningBin.DisplayResult(spinWheel, rouletteBoard); determineWin.IsSplitWin(spinWheel, splitBet, rouletteBoard); displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard); break; } case 10: { getBet.CornerBet(cornerBet); spinWheel.Spin(); displayWinningBin.DisplayResult(spinWheel, rouletteBoard); determineWin.IsCornerWin(spinWheel, cornerBet, rouletteBoard); displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard); break; } } Console.WriteLine("Hit enter to continue"); Console.ReadLine(); Console.Clear(); } while (categoryChoice != 0); }