Exemple #1
0
        public string ChooseHitOrStay(int score)
        {
            _consoleOperations.Write($"your score is {score} Hit = 1, Stay = 0");

            if (score < 18)
            {
                return("hit");
            }

            return("stay");
        }
Exemple #2
0
        public string ChooseHitOrStay(int score)
        {
            _consoleOperations.Write($"your score is {score} Hit = 1, Stay = 0");

            while (true)
            {
                var answer = _consoleOperations.Read();
                if (answer == "1")
                {
                    return("hit");
                }
                if (answer == "0")
                {
                    return("stay");
                }
                _consoleOperations.Write("Wrong choice. Hit = 1, Stay = 0");
            }
        }