Im facing issues when im attempting to make comparison between a generated code which is stored in a array and a users "Guess" which is stored in a different array
Im using a random number generator to store values in a array to act as a code as shown. NumbersArray has a size defined by a users input.
Random r = new Random();
for (int i = 0; i < numbersArray.Length; i++)
{
numbersArray[i] = r.Next(1, digitRange); //digitRange represents the maximum digit value, such as not exceeding "9"
Console.Write(numbersArray[i]);
}
This i know stores each individual digit as a place on the array.
Then the user attempts to guess the code, i then store the attempted guess on an array but currently it stores the whole number in one place on the array.
for (int i = 0; i < N; i++) // where "N" is the defined array length
{
Console.WriteLine("\nWhat is your guess?");
currentGuessArray[i] = Convert.ToInt32(Console.ReadLine());
}
How can i store the users input in the second array as each individual digit in a place on the array so both arrays have 1 digit per a position.