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; } }
public static int[] Welcome() { try { bool even = true; bool low = true; string input = ""; Console.WriteLine("\n\nWELCOME TO ROULETTE! \nAre you ready to play?" + "\n\nSelect your betting option " + "(Attention: only include the digit number.)"); var option = LetsPlay(); switch (option) { case 1: Console.WriteLine("Enter a number: "); input = Console.ReadLine(); int[] playerNumber = { Int32.Parse(input) }; return(playerNumber); case 2: return(Bet.EvenOddBet(even)); case 3: return(Bet.EvenOddBet(!even)); case 4: int[] color = { 39 }; return(color); case 5: int[] colors = { 40 }; return(colors); case 6: return(Bet.LowHighBet(low)); case 7: return(Bet.LowHighBet(!low)); case 8: Console.WriteLine("\n\nOption 1: Dozen 1-12" + "\n\nOption 2: Dozen 13-24" + "\n\nOption 3: Dozen 25-36"); input = Console.ReadLine(); return(Bet.DozenBet(Int32.Parse(input))); case 9: Console.WriteLine("\n\nOption 1: First Column" + "\n\nOption 2: Second Column" + "\n\nOption 3: Third Column"); input = Console.ReadLine(); return(Bet.ColumnBet(Int32.Parse(input))); case 10: Console.WriteLine("\n\nOption 1: Street 1 - 3" + "\n\nOption 2: Street 4-6" + "\n\nOption 3: Street 7-9" + "\n\nOption 4: Street 10-12" + "\n\nOption 5: Street 13-15" + "\n\nOption 6: Street 16-18" + "\n\nOption 7: Street 19-21" + "\n\nOption 8: Street 22-24" + "\n\nOption 9: Street 25-27" + "\n\nOption 10: Street 28-30" + "\n\nOption 11: Street 31-33" + "\n\nOption 12: Street 34-36"); input = Console.ReadLine(); return(Bet.StreetBet(Int32.Parse(input))); case 11: Console.WriteLine("\n\nOption 1: Double Stree 1 - 6" + "\n\nOption 2: Double Stree 7-12" + "\n\nOption 3: Double Stree 13-18" + "\n\nOption 4: Double Stree 19-24" + "\n\nOption 5: Double Stree 25-30" + "\n\nOption 6: Double Stree 30-36"); input = Console.ReadLine(); return(Bet.DoubleStreetBet(Int32.Parse(input))); case 12: Console.WriteLine("Enter the first continuous numbers: "); input = Console.ReadLine(); Console.WriteLine("Enter the second continuous numbers: "); string str = Console.ReadLine(); return(Bet.SplitBet(Int32.Parse(input), Int32.Parse(str))); case 13: int count = 1; for (int i = 1; i <= 36; i++) { if (i % 3 != 0) //ignore multiple of three { Console.WriteLine($"\nOption {count}: Corner {i}, {i + 1}, {i + 3} {i + 4}"); count++; } } input = Console.ReadLine(); return(Bet.CornerBet(Int32.Parse(input))); default: return(playerNumber = null); } } catch (Exception ex) { Console.WriteLine(ex.Message); } return(null); }
static void Main(string[] args) { Bet bet = new Bet(); bet.BetAmount(); }
public virtual void RecievePayout(Bet bet) { Bankroll += bet.Payout; }
static void Main(string[] args) { Wheel.PrintWheel(); Bet.GetBetType(); }
public static void PlayRoulette(int bankRoll) { Console.WriteLine(); Console.WriteLine(); Console.WriteLine(" 88 "); Console.WriteLine(" 88 ,d ,d "); Console.WriteLine(" 88 88 88 "); Console.WriteLine("8b,dPPYba, ,adPPYba, 88 88 88 ,adPPYba, MM88MMM MM88MMM, adPPYba, "); Console.WriteLine("88P\' \"Y8 a8P Y8a 88 88 88 a8P_____88 88 88 a8P_____88 "); Console.WriteLine("88 8b 88 88 88 88 8PP 88 88 8PP "); Console.WriteLine("88 \"8a, ,a8\" \"8a, ,a88 88 \"8b, ,aa 88, 88, \"8b, ,aa "); Console.WriteLine("88 `\"YbbdP\"\' `\"YbbdP\'Y8 88 `\"Ybbd8\"\' \"Y888 \"Y888 `\"Ybbd8\"\' "); Console.WriteLine(); Console.WriteLine(); var player = new Result(); var result = player.GetResult(); //foreach (var num in result) //{ // Console.WriteLine(num); //} var bet = new Bet(); int betCategoryResult = bet.GetBetCategory(); Console.WriteLine("Please Enter a Bet Amount!"); int betAmount = int.Parse(Console.ReadLine()); if (betAmount > bankRoll) { Console.WriteLine($"You do not have enough money! You have {bankRoll}"); PlayRoulette(bankRoll); } if (betCategoryResult == 1) { if (int.Parse(player._result[0]) == bet.GetNumberBet()) { bankRoll += betAmount * 35; Console.WriteLine($"You Won!!! You have ${bankRoll}"); } else { bankRoll -= betAmount; Console.WriteLine($"You Lost! You have ${bankRoll}"); } } if (betCategoryResult == 2) { if (player._result[1] == bet.GetEvenOddBet()) { bankRoll += betAmount; Console.WriteLine($"You Won!!! You have ${bankRoll}"); } else { bankRoll -= betAmount; Console.WriteLine($"You Lost! You have ${bankRoll}"); } } if (betCategoryResult == 3) { if (player._result[2] == bet.GetRedBlackBet()) { bankRoll += betAmount; Console.WriteLine($"You Won!!! You have ${bankRoll}"); } else { bankRoll -= betAmount; Console.WriteLine($"You Lost! You have ${bankRoll}"); } } if (betCategoryResult == 4) { if (player._result[3] == bet.GetHighLowBet()) { bankRoll += betAmount; Console.WriteLine($"You Won!!! You have ${bankRoll}"); } else { bankRoll -= betAmount; Console.WriteLine($"You Lost! You have ${bankRoll}"); } } if (betCategoryResult == 5) { if (int.Parse(player._result[4]) == bet.GetDozenBet()) { bankRoll += betAmount * 2; Console.WriteLine($"You Won!!! You have ${bankRoll}"); } else { bankRoll -= betAmount; Console.WriteLine($"You Lost! You have ${bankRoll}"); } } if (betCategoryResult == 6) { if (int.Parse(player._result[5]) == bet.GetColumnBet()) { bankRoll += betAmount * 2; Console.WriteLine($"You Won!!! You have ${bankRoll}"); } else { bankRoll -= betAmount; Console.WriteLine($"You Lost! You have ${bankRoll}"); } } if (betCategoryResult == 7) { if (int.Parse(player._result[6]) == bet.GetStreetBet()) { bankRoll += betAmount * 11; Console.WriteLine($"You Won!!! You have ${bankRoll}"); } else { bankRoll -= betAmount; Console.WriteLine($"You Lost! You have ${bankRoll}"); } } if (betCategoryResult == 8) { if (int.Parse(player._result[7]) == bet.GetDoubleBet()) { bankRoll += betAmount * 5; Console.WriteLine($"You Won!!! You have ${bankRoll}"); } else { bankRoll -= betAmount; Console.WriteLine($"You Lost! You have ${bankRoll}"); } } if (betCategoryResult == 9) { int[] betResult = bet.GetSplitBet(); if (int.Parse(player._result[0]) == betResult[0] || int.Parse(player._result[0]) == betResult[1]) { bankRoll += betAmount * 17; Console.WriteLine($"You Won!!! You have ${bankRoll}"); } else { bankRoll -= betAmount; Console.WriteLine($"You Lost! You have ${bankRoll}"); } } if (betCategoryResult == 10) { int[] betResult = bet.GetCorner(); if (int.Parse(player._result[0]) == betResult[0] || int.Parse(player._result[0]) == betResult[1] || int.Parse(player._result[0]) == betResult[2] || int.Parse(player._result[0]) == betResult[3]) { bankRoll += betAmount * 8; Console.WriteLine($"You Won!!! You have ${bankRoll}"); } else { bankRoll -= betAmount; Console.WriteLine($"You Lost! You have ${bankRoll}"); } } if (bankRoll == 0) { Console.WriteLine("You have no more money. Thank you for playing!"); return; } string playAgain = bet.PlayAgain(); if (playAgain == "y" || playAgain == "yes") { PlayRoulette(bankRoll); } else { Console.WriteLine("Thank you for playing! Press any key to exit!"); } }
public static int BetValueMenu(GameController controller, BetType type) { if (type == BetType.Numbers) { int status = 0; string message = ""; while (status == 0) { Console.Clear(); Header(controller); Renderer.Line(); Console.WriteLine(); if (message != "") { Console.WriteLine(message); } Console.WriteLine("\tWhat number do you want to bet on? Type 'exit' to go back. \n"); Console.Write("\t> "); string result = Console.ReadLine(); if (result == "exit") { return(0); } if (result == "00") { result = "37"; } bool isValid = false; if (!isValid) { if (byte.TryParse(result, out byte value)) { if (value >= 0 && value < 38) { isValid = true; } } } if (isValid) { Bet bet = new Bet(); bet.Payout = controller.information.Information[type].Payout; bet.WinningNumbers = new byte[] { byte.Parse(result) }; status = BetAmountMenu(controller, bet); } message = $"Invalid input: {result}"; } return(-1); } else { int current = 0; List <string> options = new List <string>(); foreach (byte[] set in controller.information.Information[type].WinningSets) { string s = "\t * { "; for (int i = 0; i < set.Length; i++) { s += i < set.Length - 1 ? set[i].ToString() + ", " : set[i].ToString() + " }"; } options.Add(s); } int numberOfPages = options.Count / 5; int currentPage = 0; do { List <string> page = options.GetRange(currentPage * 5, Clamp(5, 0, options.Count - currentPage * 5)); if (currentPage < numberOfPages) { page.Add("\tNext Page"); } if (currentPage > 0) { page.Add("\tPrevious Page"); } page.Add("\tExit Menu"); current = Clamp(page.Count - 1, 0, current); Header(controller); Renderer.Line(); Console.WriteLine(""); DisplayMenu(page, current); Renderer.Line(); var key = Console.ReadKey(true).Key; switch (key) { case (ConsoleKey.UpArrow): current = current <= 0 ? page.Count - 1 : --current; break; case (ConsoleKey.DownArrow): current = current >= page.Count - 1 ? 0 : ++current; break; case (ConsoleKey.Enter): switch (page[current]) { case "\tNext Page": currentPage++; break; case "\tPrevious Page": currentPage--; break; case "\tExit Menu": current = -1; break; default: Bet bet = new Bet(); bet.Payout = controller.information.Information[type].Payout; bet.WinningNumbers = controller.information.Information[type].WinningSets[currentPage * 5 + current]; BetAmountMenu(controller, bet); return(-1); } break; default: break; } } while (current >= 0); } return(0); }