First time the loop is being executed:
A value is assigned to PlaatSnoepArray[0,0] and PlaatSnoepArray[0,1].
Second time the loop is being executed:
A value is assigned to PlaatSnoepArray[1,0] and PlaatSnoepArray[1,1]
AND the values of PlaatSnoepArray[0,0] and PlaatSnoepArray[0,1] are set to 0.
Third time the loop is being executed:
A value is assigned to PlaatSnoepArray[2,0] and PlaatSnoepArray[2,1].
AND the values of PlaatSnoepArray[1,0] and PlaatSnoepArray[1,1] are set to 0.
How can i prevent that the values are set back to 0 ?
static Random Rangen = new Random();
static void PlaatsSnoep(int aantal)
{
for (int i = 0; i < aantal; i++)
{
int SnoepX = Rangen.Next(25, 94);
int SnoepY = Rangen.Next(3, 23);
Console.SetCursorPosition(SnoepX, SnoepY);
Console.WriteLine("0");
int[,] PlaatssnoepArray = new int[aantal,2];
PlaatssnoepArray[i, 0] = SnoepX;
PlaatssnoepArray[i, 1] = SnoepY;
}