Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Alice, choisis un nombre pour Bob : ");
            var chosedNumber = int.Parse(Console.ReadLine());

            FizzBuzzGame.AliceGiveNumberToBob(chosedNumber);
        }
Exemplo n.º 2
0
 private static IEnumerable<string> PlayGame()
 {
     var game = new FizzBuzzGame();
     for (int i = 1; i < 20; i++)
     {
         yield return game.Translate(i);
     }
 }
Exemplo n.º 3
0
        private static void Main(string[] args)
        {
            Console.WriteLine("Enter number of rounds:");
            var input = Console.ReadLine();
            var numTimes = Convert.ToInt32(input);

            var game = new FizzBuzzGame(numTimes);
            runGame(game);
        }
Exemplo n.º 4
0
        public static void runGame(FizzBuzzGame game)
        {
            for (var i = 1; i <= TimesToRun; i++)
            {
                if (isDivisbleByThree(i))
                    Message.Append("Fizz");
                else if (isDivisbleByFive(i))
                    Message.Append("Buzz");
                else
                    Message.Append(i);

                if(i != TimesToRun)
                    Message.Append(", ");
            }

            Console.Write(Message.ToString());
            Console.ReadLine();
        }
Exemplo n.º 5
0
        public static string GetResponse(int number)
        {
            string response = FizzBuzzGame.BuildResponse(number);

            return(response);
        }
Exemplo n.º 6
0
 public virtual string GetNext()
 {
     return(FizzBuzzGame.TranslateNumber(++_currentNumber));
 }