private void resimleriKaristir()
{
tokenstate.Clear();
// hamle sifirlanir - baslangic
hamle = 0;
label2.Text = hamle.ToString();
// hamle siniflanir - bitis
this.panel1.Controls.Clear(); // paneldeki tüm elemanlar silinir.
int left = 0;
int top = 0;
Random rnd = new Random();
ArrayList gen = new ArrayList(zorluk * zorluk);
for (int i = 0; i < zorluk * zorluk; i++)
{
int yeniResimIndis = rnd.Next(0, zorluk * zorluk);
while (gen.Contains(yeniResimIndis))
{
yeniResimIndis = rnd.Next(0, zorluk * zorluk);
}
PictureBox pic = (PictureBox)pboxlar[yeniResimIndis];
pic.Location = new Point(left, top);
this.panel1.Controls.Add(pic);
tokenstate.Add(pic.Tag, i);
gen.Add(yeniResimIndis);
left += en / zorluk;
if ((i + 1) % zorluk == 0)
{
left = 0;
top += boy / zorluk;
}
}
}