benim kart eşleştirme oyunu hakkında ödevim var ancak c#'ım çok gelişmiş olmadıgı için ödevi for döngüsü ile yapmayı denedim ancak yeterli değil yardımcı olabilirmisiniz.şunlarda kodlarım
for (int x = 0,y = 0,z=0; x != 3 && y != 3 && z != 3;) { x = 0; y = 0; z = 0; Random sayi = new Random(); int butn1 = sayi.Next(1, 4); if (butn1 == 1) x = x + 1; else if (butn1 == 2) y = y + 1; else if (butn1 == 3) z = z + 1; button1.Text = (butn1).ToString(); int butn2 = sayi.Next(1, 4); if (butn2 == 1) x = x + 1; else if (butn2 == 2) y = y + 1; else if (butn2 == 3) z = z + 1; button2.Text = (butn2).ToString(); int butn3 = sayi.Next(1, 4); if (butn3 == 1) x = x + 1; else if (butn3 == 2) y = y + 1; else if (butn3 == 3) z = z + 1; button3.Text = (butn3).ToString(); int butn4 = sayi.Next(1, 4); if (butn4 == 1) x = x + 1; else if (butn4 == 2) y = y + 1; else if (butn4 == 3) z = z + 1; button4.Text = (butn4).ToString(); int butn5 = sayi.Next(1, 4); if (butn5 == 1) x = x + 1; else if (butn5 == 2) y = y + 1; else if (butn5 == 3) z = z + 1; button5.Text = (butn5).ToString(); int butn6 = sayi.Next(1, 4); if (butn6 == 1) x = x + 1; else if (butn6 == 2) y = y + 1; else if (butn6 == 3) z = z + 1; button6.Text = (butn6).ToString(); int butn7 = sayi.Next(1, 4); if (butn7 == 1) x = x + 1; else if (butn6 == 2) y = y + 1; else if (butn6 == 3) z = z + 1; button7.Text = (butn7).ToString(); int butn8 = sayi.Next(1, 4); if (butn8 == 1) x = x + 1; else if (butn8 == 2) y = y + 1; else if (butn8 == 3) z = z + 1; button8.Text = (butn8).ToString(); int butn9 = sayi.Next(1, 4); if (butn9 == 1) x = x + 1; else if (butn9 == 2) y = y + 1; else if (butn9 == 3) z = z + 1; button9.Text = (butn9).ToString(); }
1. sayfa
Hizmet kalitesi için çerezleri kullanabiliriz, DH'yi kullanırken depoladığımız çerezlerle ilgili veri politikamıza gözatın.
for (int x = 0,y = 0,z=0; x != 3 && y != 3 && z != 3;)
{
x = 0;
y = 0;
z = 0;
Random sayi = new Random();
int butn1 = sayi.Next(1, 4);
if (butn1 == 1)
x = x + 1;
else if (butn1 == 2)
y = y + 1;
else if (butn1 == 3)
z = z + 1;
button1.Text = (butn1).ToString();
int butn2 = sayi.Next(1, 4);
if (butn2 == 1)
x = x + 1;
else if (butn2 == 2)
y = y + 1;
else if (butn2 == 3)
z = z + 1;
button2.Text = (butn2).ToString();
int butn3 = sayi.Next(1, 4);
if (butn3 == 1)
x = x + 1;
else if (butn3 == 2)
y = y + 1;
else if (butn3 == 3)
z = z + 1;
button3.Text = (butn3).ToString();
int butn4 = sayi.Next(1, 4);
if (butn4 == 1)
x = x + 1;
else if (butn4 == 2)
y = y + 1;
else if (butn4 == 3)
z = z + 1;
button4.Text = (butn4).ToString();
int butn5 = sayi.Next(1, 4);
if (butn5 == 1)
x = x + 1;
else if (butn5 == 2)
y = y + 1;
else if (butn5 == 3)
z = z + 1;
button5.Text = (butn5).ToString();
int butn6 = sayi.Next(1, 4);
if (butn6 == 1)
x = x + 1;
else if (butn6 == 2)
y = y + 1;
else if (butn6 == 3)
z = z + 1;
button6.Text = (butn6).ToString();
int butn7 = sayi.Next(1, 4);
if (butn7 == 1)
x = x + 1;
else if (butn6 == 2)
y = y + 1;
else if (butn6 == 3)
z = z + 1;
button7.Text = (butn7).ToString();
int butn8 = sayi.Next(1, 4);
if (butn8 == 1)
x = x + 1;
else if (butn8 == 2)
y = y + 1;
else if (butn8 == 3)
z = z + 1;
button8.Text = (butn8).ToString();
int butn9 = sayi.Next(1, 4);
if (butn9 == 1)
x = x + 1;
else if (butn9 == 2)
y = y + 1;
else if (butn9 == 3)
z = z + 1;
button9.Text = (butn9).ToString();
}