Lets say I have a 2D array:
int[,] array = {
{1,2,4},
{5,6,7}
};
Now we want the user to enter a value into that array. Lets say 7. So now the array looks like this:
int[,] array = {
{7,2,4},
{5,6,7}
};
Now another user or even the same user tries to enter 7 into the same element. I want the program to deny this. So it would give the user a message something like: "Error that element contains a 7, no other values can be entered into this element. This is permanent, once a 7 is in any element of this array, it can never be changed unless the program is restarted.
I know this might seem simple, and I could have messed around with arrays to find a solution. But I want to know a good way of doing this instead of guessing. Or hacking it.
The List.IndexOf() method seems like something I might use, but this is an array and that is a list, should I change it to a list? I really don't know. I am not even sure if using IndexOf is a good way to do this.
So I ask the masters.