static string PlayerName1;
static string PlayerName2;
static int Player1PointsScored;
static int Player2PointsScored;
static string[] ScoreDisplay = new[] {"Love", "15", "30", "40", "Game"};
public static void Main()
while(GameIsNotOver() == false)
public static void SetScoresToZero()
public static void PrintCurrentScores()
Console.WriteLine("Current scores are " + Player1PointsScored + " : " + Player2PointsScored);
public static void AdvantageRuling()
Console.WriteLine("Game is at Deuce! You need to win by two to take the game.");
public static bool GameIsNotOver()
if (Player1PointsScored != 50 && Player2PointsScored != 50)
Console.WriteLine("Congratulations! You've won the game!");
public static void GetNextScore()
Console.WriteLine("Who scored? Enter A for " + PlayerName1 + " or B for " + PlayerName2);
WhoScored = Console.ReadLine();
if (WhoScored == "A" && (Player1PointsScored == 0 || Player1PointsScored == 15))
Player1PointsScored = Player1PointsScored + 15;
else if (WhoScored == "A" && Player1PointsScored == 30)
Player1PointsScored = Player1PointsScored + 10;
else if (WhoScored == "B" && (Player2PointsScored == 0 || Player2PointsScored == 15))
Player2PointsScored = Player2PointsScored + 15;
else if (WhoScored == "B" && Player2PointsScored == 30)
Player2PointsScored = Player2PointsScored + 10;
else if (Player1PointsScored == 40 && Player2PointsScored == 40)
Player1PointsScored.ToString("Deuce");
Player2PointsScored.ToString("Deuce");
Console.WriteLine(Player1PointsScored + " : " + Player2PointsScored);
Console.WriteLine("Invalid input - try again you fool 'A' or 'B'!");
public static void GetPlayerNames()
Console.WriteLine("Player name 1:");
PlayerName1 = Console.ReadLine();
Console.WriteLine("Player name 2");
PlayerName2 = Console.ReadLine();
if (PlayerName1 == "Tom")
Console.WriteLine("Glad to see you playing Master Tom.");