Blackjack program in c3/11/2024 ![]() } while (!action.ToUpper().Equals("STAND") & !action.ToUpper().Equals("DOUBLE") If (card.Value = 11) // Only a soft ace can have a value of 11 / Ask user for action and perform that action until they stand, double, or bust.Ĭonsole.Write("Enter Action (? for help): ") Ĭonsole.ForegroundColor = ConsoleColor.Cyan While (Dealer.GetHandValue() Dealer.GetHandValue())Įlse if (Dealer.GetHandValue() > player.GetHandValue()) If hand contains two aces, make one Hard. / Initialize Deck, deal the player and dealer hands, and display them. Private static Player player = new Player() You should have received a copy of the GNU General Public License GNU General Public License for more details. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This program is distributed in the hope that it will be useful,īut WITHOUT ANY WARRANTY without even the implied warranty of The Free Software Foundation, either version 3 of the License, or It under the terms of the GNU General Public License as published by This program is free software: you can redistribute it and/or modify There are 4 files: Program.cs /* Blackjack Game Copyright (C) 2018 I am wondering how I can better organize or simplify my code. I recently finished a simple Blackjack game that I made to get better at C#.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |