Difference between revisions of "GetStartingHand"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Created page with "<syntaxhighlight lang=csharp> private static string GetStartingHand(QueueOfTiles TileQueue, int StartHandSize) { string Hand = ""; for...")
 
 
Line 11: Line 11:
 
         }
 
         }
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
This code removes one tile from the TileQueue, then adds this tile into the players hand. A replacement tile is then added to the back of the TileQueue and repeats this process until the Count is equal to StartHandSize.

Latest revision as of 14:27, 14 November 2017

        private static string GetStartingHand(QueueOfTiles TileQueue, int StartHandSize)
        {
            string Hand = "";
            for (int Count = 0; Count < StartHandSize; Count++)
            {
                Hand = Hand + TileQueue.Remove();
                TileQueue.Add();
            }
            return Hand;
        }

This code removes one tile from the TileQueue, then adds this tile into the players hand. A replacement tile is then added to the back of the TileQueue and repeats this process until the Count is equal to StartHandSize.