【发布时间】:2014-02-03 19:43:51
【问题描述】:
我正在创建一个井字游戏,对于再次游戏部分,我得到了一个无效的 else 表达,有人可以帮忙吗?在我添加介绍程序之前它起作用了 提前致谢
static void playAgainMsg(String message)
{
Console.WriteLine(message + "Do you want to play again? Y/N"); // Displaying the resukt of the game and asking the user if they would like to play again and tells them to input Y or N
if
{
(Console.ReadLine().Equals("Y")) // This reads the line to check the user input
strPlaysAgain.Equals("Y");
introduction(); <---- worked before this was added...
}
else
{
strPlaysAgain.Equals("N"); // This Changes the value from the default value of Y to N so that it exits the While loop for PlaysAgain.
Console.Clear(); //Clears the console so that the game board is removed.
MainMenu(); // returns the user back to the introduction - edit to be main menu with an exit feature, highscores
}
}
【问题讨论】:
标签: c# command-line console console-application