When a word is valid, display the word and the score for the word

From TRCCompSci - AQA Computer Science
Revision as of 09:50, 14 May 2018 by Charley (talk | contribs) (Created page with "In the subroutine HaveTurn: if (ValidWord) { ValidWord = CheckWordIsValidBinary(Choice, AllowedWords); if...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

In the subroutine HaveTurn:

if (ValidWord)

                   {
                       ValidWord = CheckWordIsValidBinary(Choice, AllowedWords);
                       if (ValidWord)
                       {
                           Console.WriteLine();
                           Console.WriteLine("Valid word");
                           Console.WriteLine(Choice + ": " + GetScoreForWord(Choice, TileDictionary) + " points");
                           Console.WriteLine();
                           UpdateAfterAllowedWord(Choice, ref PlayerTiles, ref PlayerScore, ref PlayerTilesPlayed, TileDictionary, AllowedWords);
                           NewTileChoice = GetNewTileChoice();

The line Console.WriteLine(Choice + ": " + GetScoreForWord(Choice, TileDictionary) + " points"); will display the word and its score.