Difference between revisions of "Deduct points from score if invalid word entered"
Line 2: | Line 2: | ||
<syntaxhighlight lang=Csharp> | <syntaxhighlight lang=Csharp> | ||
+ | // something here ... | ||
if (!ValidWord) | if (!ValidWord) | ||
{ | { | ||
Line 8: | Line 9: | ||
Console.WriteLine(); | Console.WriteLine(); | ||
} | } | ||
+ | // something here... | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 09:26, 20 November 2017
Under HaveTurn, you'll see this bit of code:
// something here ...
if (!ValidWord)
{
Console.WriteLine();
Console.WriteLine("Not a valid attempt, you lose your turn.");
Console.WriteLine();
}
// something here...
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(); }