Difference between revisions of "When a word is valid, display the word and the score for the word"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Created page with "In the subroutine HaveTurn: if (ValidWord) { ValidWord = CheckWordIsValidBinary(Choice, AllowedWords); if...")
(No difference)

Revision as of 09:50, 14 May 2018

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.