I've made this code for practicing and I want to make a list that keeps every number that this code wrote before so I don't want to get duplicates.
It's just guessing random numbers and I don't want it to guess the number that it already guessed before.
Just to be clear I want to make it as a list
int password = 432678;
int valt = 999999;
for (int i = 0; i < valt; i++)
{
int[] test2 = new int[valt];
Random randNum = new Random();
for (int j = 0; j < test2.Length; j++)
{
test2[i] = randNum.Next(1, valt);
Console.WriteLine("CURRENT: " + test2[i]);
if (test2[i] == password)
{
goto Back;
}
}
}
Back:
Console.WriteLine("password: "+ password);
Console.ReadLine();