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); }
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(); }