AS 2019 DisplayErrorMessages

From TRCCompSci - AQA Computer Science
Revision as of 08:43, 1 April 2019 by Admin (talk | contribs) (Created page with "=Where= The SetupBoard method has a try & catch block, this runs DisplayErrorCode(4), this will be an error when loading the file. The SelectMove method has a try & catch blo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Where

The SetupBoard method has a try & catch block, this runs DisplayErrorCode(4), this will be an error when loading the file.

The SelectMove method has a try & catch block, this runs DisplayErrorCode(3), this will be an error cause by entering a non integer value for the Row or Column.

The SelectMove method also runs DisplayErrorCode(1), this be displayed because the piece doesn't exit.

The SelectMove method also runs DisplayErrorCode(2), this will be displayed when the piece you are trying to move can't move. ie it is not in the list of possible moves.


       private static void DisplayErrorCode(int errorNumber)
       {
           Console.WriteLine("Error " + errorNumber);
       }