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
 
Line 4: Line 4:
 
if (ValidWord)
 
if (ValidWord)
 
                     {
 
                     {
                         ValidWord = CheckWordIsValidBinary(Choice, AllowedWords);
+
                         ValidWord = CheckWordIsValid(Choice, AllowedWords);
 
                         if (ValidWord)
 
                         if (ValidWord)
 
                         {
 
                         {

Latest revision as of 09:58, 14 May 2018

In the subroutine HaveTurn:

if (ValidWord)
                    {
                        ValidWord = CheckWordIsValid(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.