Esempio n. 1
0
        private void replay()
        {
            StringBuilder endMessgae = new StringBuilder();

            if (r_MemoryGame.isTie())
            {
                endMessgae.Append("Oh no, there's a tie!");
            }
            else
            {
                endMessgae.AppendFormat("And the winner is...{0}! with a score of {1}", r_MemoryGame.GetWinner().Name, r_MemoryGame.GetWinner().Score);
            }

            endMessgae.AppendLine();
            endMessgae.AppendLine("Would you like to play again?");
            DialogResult answer = MessageBox.Show(endMessgae.ToString(), "Game Over", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (answer.Equals(DialogResult.Yes))
            {
                MemoryGameForm newGame = new MemoryGameForm(r_SettingsForm);
                Dispose();
            }
            else
            {
                Dispose();
                Close();
            }
        }
Esempio n. 2
0
 static void Main()
 {
     MemoryGameForm gameForm = new MemoryGameForm();
 }