GetStartingHand

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
        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.