Difference between revisions of "Deduct points from score if invalid word entered"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Created page with "Under HaveTurn, you'll see this bit of code: if (!ValidWord) { Console.WriteLine(); Console.WriteLine("Not...")
 
Line 1: Line 1:
 
Under HaveTurn, you'll see this bit of code:
 
Under HaveTurn, you'll see this bit of code:
  
 +
<syntaxhighlight lang=Csharp>
 
if (!ValidWord)
 
if (!ValidWord)
 
                     {
 
                     {
Line 7: Line 8:
 
                         Console.WriteLine();
 
                         Console.WriteLine();
 
                     }
 
                     }
 +
</syntaxhighlight>
  
 
You can deduct a number of points from the player's score by adding one line:
 
You can deduct a number of points from the player's score by adding one line:

Revision as of 10:25, 20 November 2017

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();
                   }