Deduct points from score if invalid word entered

From TRCCompSci - AQA Computer Science
Revision as of 10:25, 20 November 2017 by Charley (talk | contribs) (Created page with "Under HaveTurn, you'll see this bit of code: if (!ValidWord) { Console.WriteLine(); Console.WriteLine("Not...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Under HaveTurn, you'll see this bit of code:

if (!ValidWord)

                   {
                       Console.WriteLine();
                       Console.WriteLine("Not a valid attempt, you lose your turn.");
                       Console.WriteLine();
                   }

You can deduct a number of points from the player's score by adding one line:

if (!ValidWord)

                   {
                       Console.WriteLine();
                       Console.WriteLine("Not a valid attempt, you lose your turn.");
                       PlayerScore = PlayerScore - 10;
                       Console.WriteLine();
                   }