Changing value in integer array in an index works in one case, and in another not, why?

0

privatevoidbtnRodaLabirinto_Click(objectsender,EventArgse){char[,]Lab=newchar[10,10];int[,]Lab2=newint[10,10];intI=0,J=0;RandomNumerosRandomicos=newRandom();//abaixo,setandolabirintocom0e1for(I=0;I<10;I++){for(J=0;J<10;J++){Lab2[I,J]=NumerosRandomicos.Next(0,2);if(I==9&&J==9)Lab2[I,J]=3;if(I==0&&J==0)Lab2[I,J]=3;}}//PrintandonaTexboxfor(I=0;I<10;I++){for(J=0;J<10;J++){txtLabirinto.Text=txtLabirinto.Text+Convert.ToString(Lab2[I,J]).ToString();}txtLabirinto.AppendText("\r\n");
        }

    }

I've already done out of for, like this:

   I = 0;
   J = 0;
   Lab2[I, J] = 3;

But without success too, can anyone help me?

    
asked by anonymous 01.03.2018 / 15:00

0 answers