GetNewTileChoice

From TRCCompSci - AQA Computer Science
Revision as of 12:54, 14 November 2017 by Admin (talk | contribs) (Created page with "<syntaxhighlight lang=csharp> private static string GetNewTileChoice() { string NewTileChoice = ""; string[] TileChoice = { "1", "2", "...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
        private static string GetNewTileChoice()
        {
            string NewTileChoice = "";
            string[] TileChoice = { "1", "2", "3", "4" };
            while (Array.IndexOf(TileChoice, NewTileChoice) == -1)
            {
                Console.WriteLine("Do you want to:");
                Console.WriteLine("     replace the tiles you used (1) OR");
                Console.WriteLine("     get three extra tiles (2) OR");
                Console.WriteLine("     replace the tiles you used and get three extra tiles (3) OR");
                Console.WriteLine("     get no new tiles (4)?");
                Console.Write("> ");
                NewTileChoice = Console.ReadLine();
            }
            return NewTileChoice; ;
        }