Began to master recently C #. It is necessary to make a program that would guess the number that the user made. The user can click the "more" or "less" buttons. There is an array of random numbers from which a number is randomly selected. I can not understand a little how to program the "less" button so that when it is pressed, numbers from the array are output only those that are smaller than the number that was displayed to the user.
public Form1() { InitializeComponent(); int[] array = new int[20]; Random rnd = new Random(); for (int i = 1; i < array.Length; i++) { array[i] = rnd.Next(0, 20); label1.Text = array[new Random().Next(0, array.Length)].ToString(); } }
Here is the random number picker from the array.