public static void Main(string[] args)
int numCorrectGuesses = 0;
Random rand = new Random();
Console.WriteLine("Welcome to the coin flipping game!!!");
int coinFlip = rand.Next(2);
Console.Write("Guess the result of the coin flip (0 for heads, 1 for tails): ");
int guess = int.Parse(Console.ReadLine());
Console.WriteLine("You guessed correctly!");
Console.WriteLine("Sorry, you guessed incorrectly.");
if (numCorrectGuesses >= 6)
Console.WriteLine("Congratulations! You won!");
else if (numCorrectGuesses >= 5)
Console.Write("You played well, but didn't quite win. Would you like to play again? (y/n): ");
string playAgainResponse = Console.ReadLine();
playAgain = (playAgainResponse.ToLower() == "y");
Console.WriteLine("Sorry, you lost.");
Console.WriteLine("Thanks for playing!");