Ejemplo n.º 1
0
        // Tally the score and declare a winner
        public void End()
        {
            // This has likely already been made false, but let's be safe
            active = false;

            int[] scores = board.GetScores();

            String message = "Black wins!";

            if (scores[0] == scores[1])
            {
                message = "The game is a draw.";
            }
            else if (scores[0] < scores[1])
            {
                message = "White wins!";
            }

            Console.Clear();

            Console.WriteLine(
                board.GetBoardAsString() +
                "\nGame Over!\n" +
                "The final score is:\n" +
                "Black: " + scores[0] + "\tWhite: " + scores[1] + "\n" +
                message
                );
        }