Ejemplo n.º 1
0
        private static bool userInputCheck(string userInput, GameBoard gameBoard)
        {
            var userInputParse = 0;

            try
            {
                userInputParse = int.Parse(userInput);
            }
            catch (Exception)
            {
                Console.WriteLine("Something went wrong... try again!");
            }

            if (userInputParse >= 1 && userInputParse < 10)
            {
                gameBoard.SetLatestNumber(userInputParse);
                return(true);
            }
            return(false);
        }