public void dealersChoice(int dealersTotalOfFirstDraw) { Random rnd = new Random(); if (dealersTotalOfFirstDraw < playersHandTotal) { int dealersNextCard = 0; dealersNextCard = rnd.Next(1, 12); Console.WriteLine("Dealer's next card is {0}", dealersNextCard); dealersTotalOfFirstDraw += dealersNextCard; Console.WriteLine("Dealer's current total is: {0}", dealersTotalOfFirstDraw); ScoreCheckDealer(dealersTotalOfFirstDraw); } else if (dealersTotalOfFirstDraw > playersHandTotal) { Console.WriteLine("Dealer Wins!!"); CSharp.Program casinoGame = new CSharp.Program(); casinoGame.HouseWinning(); } else if (dealersTotalOfFirstDraw == playersHandTotal) { Console.WriteLine("Tie"); CSharp.Program casinoGame = new CSharp.Program(); casinoGame.playAgain(); } }
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 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(); } }