GetNewTileChoice

From TRCCompSci - AQA Computer Science
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; ;
        }