1. sayfa
kart oyununu anlat bakayım nedir ona göre bakalım yani tam olarak nasıl oynanıyor |
Oyunun mantigi ne soylersen belki yardimci olabilirim |
oyunun mantığı şu şekilde tüm kartlar kapalı 2 kartı seçtiğinizde eğer eşleşirse puan kazanıyorsunuz hepsini açtığınızda oyun bitiyor |
int x = 0; int y = 0; int z = 0; int a = 0; int b = 0; int c = 0; int d = 0; int q = 0; sayac = 0; timer1.Enabled = true; for (; x != 2 || y != 2 || z != 2 || a != 2 || b !=2 || c !=2 || d !=2 || q !=2; ) { x = 0; y = 0; z = 0; a = 0; b = 0; c = 0; d = 0; q = 0; Random sayi = new Random(); int butn1 = sayi.Next(1, 9); if (butn1 == 1) x = x + 1; else if (butn1 == 2) y = y + 1; else if (butn1 == 3) z = z + 1; else if (butn1 == 4) a = a + 1; else if (butn1 == 5) b = b + 1; else if (butn1 == 6) c = c + 1; else if (butn1 == 7) d = d + 1; else if (butn1 == 8) q = q + 1; button1.Text = (butn1).ToString(); int butn2 = sayi.Next(1, 9); if (butn2 == 1) x = x + 1; else if (butn2 == 2) y = y + 1; else if (butn2 == 3) z = z + 1; else if (butn2 == 4) a = a + 1; else if (butn2 == 5) b = b + 1; else if (butn2 == 6) c = c + 1; else if (butn2 == 7) d = d + 1; else if (butn2 == 8) q = q + 1; button2.Text = (butn2).ToString(); int butn3 = sayi.Next(1, 9); if (butn3 == 1) x = x + 1; else if (butn3 == 2) y = y + 1; else if (butn3 == 3) z = z + 1; else if (butn3 == 4) a = a + 1; else if (butn3 == 5) b = b + 1; else if (butn3 == 6) c = c + 1; else if (butn3 == 7) d = d + 1; else if (butn3 == 8) q = q + 1; button3.Text = (butn3).ToString(); int butn4 = sayi.Next(1, 9); if (butn4 == 1) x = x + 1; else if (butn4 == 2) y = y + 1; else if (butn4 == 3) z = z + 1; else if (butn4 == 4) a = a + 1; else if (butn4 == 5) b = b + 1; else if (butn4 == 6) c = c + 1; else if (butn4 == 7) d = d + 1; else if (butn4 == 8) q = q + 1; button4.Text = (butn4).ToString(); int butn5 = sayi.Next(1, 9); if (butn5 == 1) x = x + 1; else if (butn5 == 2) y = y + 1; else if (butn5 == 3) z = z + 1; else if (butn5 == 4) a = a + 1; else if (butn5 == 5) b = b + 1; else if (butn5 == 6) c = c + 1; else if (butn5 == 7) d = d + 1; else if (butn5 == 8) q = q + 1; button5.Text = (butn5).ToString(); int butn6 = sayi.Next(1, 9); if (butn6 == 1) x = x + 1; else if (butn6 == 2) y = y + 1; else if (butn6 == 3) z = z + 1; else if (butn6 == 4) a = a + 1; else if (butn6 == 5) b = b + 1; else if (butn6 == 6) c = c + 1; else if (butn6 == 7) d = d + 1; else if (butn6 == 8) q = q + 1; button6.Text = (butn6).ToString(); int butn7 = sayi.Next(1, 9); if (butn7 == 1) x = x + 1; else if (butn7 == 2) y = y + 1; else if (butn7 == 3) z = z + 1; else if (butn7 == 4) a = a + 1; else if (butn7 == 5) b = b + 1; else if (butn7 == 6) c = c + 1; else if (butn7 == 7) d = d + 1; else if (butn7 == 8) q = q + 1; button7.Text = (butn7).ToString(); int butn8 = sayi.Next(1, 9); if (butn8 == 1) x = x + 1; else if (butn8 == 2) y = y + 1; else if (butn8 == 3) z = z + 1; else if (butn8 == 4) a = a + 1; else if (butn8 == 5) b = b + 1; else if (butn8 == 6) c = c + 1; else if (butn8 == 7) d = d + 1; else if (butn8 == 8) q = q + 1; button8.Text = (butn8).ToString(); int butn9 = sayi.Next(1, 9); if (butn9 == 1) x = x + 1; else if (butn9 == 2) y = y + 1; else if (butn9 == 3) z = z + 1; else if (butn9 == 4) a = a + 1; else if (butn9 == 5) b = b + 1; else if (butn9 == 6) c = c + 1; else if (butn9 == 7) d = d + 1; else if (butn9 == 8) q = q + 1; button9.Text = (butn9).ToString(); int butn10 = sayi.Next(1, 9); if (butn10 == 1) x = x + 1; else if (butn10 == 2) y = y + 1; else if (butn10== 3) z = z + 1; else if (butn10== 4) a = a + 1; else if (butn10== 5) b = b + 1; else if (butn10 == 6) c = c + 1; else if (butn10== 7) d = d + 1; else if (butn10== 8) q = q + 1; button10.Text = (butn10).ToString(); int butn11 = sayi.Next(1, 9); if (butn11 == 1) x = x + 1; else if (butn11 == 2) y = y + 1; else if (butn11 == 3) z = z + 1; else if (butn11 == 4) a = a + 1; else if (butn11 == 5) b = b + 1; else if (butn11 == 6) c = c + 1; else if (butn11 == 7) d = d + 1; else if (butn11 == 8) q = q + 1; button11.Text = (butn11).ToString(); int butn12 = sayi.Next(1, 9); if (butn12 == 1) x = x + 1; else if (butn12 == 2) y = y + 1; else if (butn12 == 3) z = z + 1; else if (butn12 == 4) a = a + 1; else if (butn12 == 5) b = b + 1; else if (butn12 == 6) c = c + 1; else if (butn12 == 7) d = d + 1; else if (butn12 == 8) q = q + 1; button12.Text = (butn12).ToString(); int butn13 = sayi.Next(1, 9); if (butn13 == 1) x = x + 1; else if (butn13 == 2) y = y + 1; else if (butn13 == 3) z = z + 1; else if (butn13 == 4) a = a + 1; else if (butn13 == 5) b = b + 1; else if (butn13 == 6) c = c + 1; else if (butn13 == 7) d = d + 1; else if (butn13 == 8) q = q + 1; button13.Text = (butn13).ToString(); int butn14 = sayi.Next(1, 9); if (butn14 == 1) x = x + 1; else if (butn14 == 2) y = y + 1; else if (butn14 == 3) z = z + 1; else if (butn14 == 4) a = a + 1; else if (butn14 == 5) b = b + 1; else if (butn14 == 6) c = c + 1; else if (butn14 == 7) d = d + 1; else if (butn14 == 8) q = q + 1; button14.Text = (butn14).ToString(); int butn15 = sayi.Next(1, 9); if (butn15 == 1) x = x + 1; else if (butn15 == 2) y = y + 1; else if (butn15 == 3) z = z + 1; else if (butn15 == 4) a = a + 1; else if (butn15 == 5) b = b + 1; else if (butn15 == 6) c = c + 1; else if (butn15 == 7) d = d + 1; else if (butn15 == 8) q = q + 1; button15.Text = (butn15).ToString(); int butn16 = sayi.Next(1, 9); if (butn16 == 1) x = x + 1; else if (butn16 == 2) y = y + 1; else if (butn16 == 3) z = z + 1; else if (butn16 == 4) a = a + 1; else if (butn16 == 5) b = b + 1; else if (butn16 == 6) c = c + 1; else if (butn16 == 7) d = d + 1; else if (butn16 == 8) q = q + 1; button16.Text = (butn16).ToString(); } |
sol üste iki tane yanyana label ekle label1 puan yazsın label2 boş olsun daha da geliştirilebilir
|
1. sayfa
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();
}
DH forumlarında vakit geçirmekten keyif alıyor gibisin ancak giriş yapmadığını görüyoruz.
Üye Ol Şimdi DeğilÜye olduğunda özel mesaj gönderebilir, beğendiğin konuları favorilerine ekleyip takibe alabilir ve daha önce gezdiğin konulara hızlıca erişebilirsin.