Exemplo n.º 1
0
 public static bool NumbersCorrespond(UserNumbers userNumers, NumberGenerator generator)
 {
     for (int i = 0; i < NumberGenerator.amountNumbers; i++)
     {
         if (userNumers[i] != generator[i])
         {
             return(false);
         }
     }
     return(true);
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var generator = new NumberGenerator();
            var userNum   = new UserNumbers();

            UserUtil.StartUserEntering(userNum);
            if (UserUtil.NumbersCorrespond(userNum, generator))
            {
                Console.WriteLine("Congratulations, you guessed right!");
            }
            else
            {
                Console.Write("You did not guess. Generated numbers: ");
                generator.ShowGeneratedNumbers();
            }
            Console.ReadKey();
        }