GetStartingHand

From TRCCompSci - AQA Computer Science
Revision as of 14:27, 14 November 2017 by LankDaddy (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.