Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
class Program
{
static void Main(string[] args)
{
// Set the initial balance for the game
int initialBalance = 1000;
// Initialize game components
GameRules gameRules = new GameRules(); // Object to define the rules of the game
RoundHistory roundHistory = new RoundHistory(); // Object to keep track of round history
ResultDisplay resultDisplay = new ResultDisplay(); // Object to display game results
// Initialize the game manager with the provided initial balance, game rules, round history, and result display
GameManager gameManager = new GameManager(initialBalance, gameRules, roundHistory, resultDisplay);
// Main game loop
while (true)
{
// Play a round of the game
gameManager.PlayRound();
// Ask the user if they want to play again
Console.Write("Do you want to play again? (y/n): ");
string playAgain = Console.ReadLine();
// If the user doesn't want to play again, exit the loop
if (playAgain.ToLower() != "y")
{
break;
}
}
// Display game history after the game is over
gameManager.DisplayHistory();
}
}