public void ScoreCheckPlayer(int playersTotal) { if (playersTotal >= 22) { Console.WriteLine("Bust"); CSharp.Program casinoGame = new CSharp.Program(); casinoGame.HouseWinning(); } else if (playersTotal == 21) { Console.WriteLine("BlackJack!!"); CSharp.Program casinoGame = new CSharp.Program(); casinoGame.PlayerWinnings(); } else { PlayerChoices(); } }
public void ScoreCheckDealer(int dealersTotalOfFirstDraw) { if (dealersTotalOfFirstDraw >= 22) { Console.WriteLine("Dealer bust, player wins"); CSharp.Program casinoGame = new CSharp.Program(); casinoGame.PlayerWinnings(); } else if (dealersTotalOfFirstDraw == 21) { Console.WriteLine("BlackJack!! Dealer wins!!"); CSharp.Program casinoGame = new CSharp.Program(); casinoGame.HouseWinning(); } else { dealersChoice(dealersTotalOfFirstDraw); } }
public void playerNumberThgrough() { input = Console.ReadLine(); Random rnd = new Random(); int numbers = rnd.Next(0, 38); Console.WriteLine("Number is {0}", numbers); if (playerInput == numbers) { Console.WriteLine("You win!!"); CSharp.Program casinoGame = new CSharp.Program(); casinoGame.PlayerWinnings(); } else { Console.WriteLine("You lose"); CSharp.Program casinoGame = new CSharp.Program(); casinoGame.HouseWinning(); } }
public void dealersHand() { Random rnd = new Random(); int dealersFirstCard = rnd.Next(1, 12); Console.WriteLine("Dealer's first card is: {0}", dealersFirstCard); int dealersSecondCard = rnd.Next(1, 12); Console.WriteLine("Dealer's second card is: {0}", dealersSecondCard); dealersTotalOfFirstDraw = dealersFirstCard += dealersSecondCard; Console.WriteLine("Dealer's total is: {0}", dealersTotalOfFirstDraw); if (dealersTotalOfFirstDraw == 21) { Console.WriteLine("BlackJack!! Dealer Wins"); CSharp.Program casinoGame = new CSharp.Program(); casinoGame.PlayerWinnings(); } else { dealersChoice(dealersTotalOfFirstDraw); } }
public void playerOddsThrough() { input = Console.ReadLine(); Random rnd = new Random(); string[] odds = { "Even", "Odd" }; int oIndex = rnd.Next(odds.Length); Console.WriteLine("{0}", odds[oIndex]); if (input == odds[oIndex]) { Console.WriteLine("You win!!"); CSharp.Program casinoGame = new CSharp.Program(); casinoGame.PlayerWinnings(); } else { Console.WriteLine("You lose"); CSharp.Program casinoGame = new CSharp.Program(); casinoGame.HouseWinning(); } }
public void colourPlayThrough() { input = Console.ReadLine(); Random rnd = new Random(); string[] colours = { "Black", "Red" }; int cIndex = rnd.Next(colours.Length); Console.WriteLine("The colour is {0}", colours[cIndex]); if (input == colours[cIndex]) { Console.WriteLine("You win!!"); CSharp.Program casinoGame = new CSharp.Program(); casinoGame.PlayerWinnings(); } else { Console.WriteLine("You lose"); CSharp.Program casinoGame = new CSharp.Program(); casinoGame.HouseWinning(); } }
public void PlayerChoices() { Console.WriteLine("Hit or Stand?"); input = Console.ReadLine(); Random rnd = new Random(); if (input == "Hit") { playersNextCard = rnd.Next(1, 12); Console.WriteLine("Your next card is {0}", playersNextCard); playersTotal += playersNextCard; Console.WriteLine("Your total is: {0}", playersTotal); ScoreCheckPlayer(playersTotal); input = Console.ReadLine(); PlayerChoices(); } else if (input == "Stand") { playersHandTotal += playersTotal; Console.WriteLine("You have stand at {0}, dealers turn", playersHandTotal); if (playersTotal >= 22) { Console.WriteLine("Bust"); CSharp.Program casinoGame = new CSharp.Program(); casinoGame.HouseWinning(); } else if (playersTotal == 21) { Console.WriteLine("BlackJack!!"); CSharp.Program casinoGame = new CSharp.Program(); casinoGame.PlayerWinnings(); } Console.Read(); dealersHand(); } }