⏩ OldSchoolKO ✅ | " VALHALLA " 2.000.000 TL ÖDÜL ⭐ 3 YIL ARADAN SONRA ✅ v.1098 MYKO EFSANESİ ⚔ OFFICIAL 17.05.2024 - 21:00 ⏪
Cuceko

Derste kaçamak yaparak oluşturduğum ufak bir oyun

  •         

            

            

            

            

  • HyperFilter | DoS Protection | DDoS Protection | DoS Mitigation | DDoS Mitigation | AntiDoS | AntiDDoS | Proxy Shielding
C Çevrimdışı

Code

Kayıtlı Üye
27 Ekim 2012
56
0
6
Öncelikle proje olarak alamadım :( Sadece kodlarını alabildim.Umarım yeni başlayan arkadaşlar kodları inceleyerek mantığını anlayabilir.



Kod:
       int hak = 5, rSayi, tSayi;

        string b, a;

        public Form1()

        {

            InitializeComponent();

        }



        private void Form1_Load(object sender, EventArgs e)

        {

            Random r = new Random();

            rSayi = r.Next(10);

            label1.Text = rSayi.ToString();

            toolStripStatusLabel1.Text = "Rasgele sayı oluşturuldu.";

            toolStripStatusLabel2.Text = "Kalan Hakkınız 5";

            button2.Visible = false;



        }



        private void button1_Click(object sender, EventArgs e)

        {

            tSayi = int.Parse(comboBox1.Text);

            if (hak > 0)

            {

                if (tSayi < rSayi)

                {

                    hak = --hak;

                    toolStripStatusLabel1.Text = "Daha büyük bir sayı giriniz";

                    toolStripStatusLabel2.Text = "Kalan Hakkınız";

                    toolStripStatusLabel2.Text = toolStripStatusLabel2 + " " + hak.ToString();

                    comboBox1.Items.Add(tSayi);

                }

                else if (tSayi > rSayi)

                {

                    hak = --hak;

                    toolStripStatusLabel1.Text = "Daha küçük bir sayı giriniz";

                    toolStripStatusLabel2.Text = "Kalan Hakkınız";

                    toolStripStatusLabel2.Text = toolStripStatusLabel2 + " " + hak.ToString();

                    comboBox1.Items.Add(tSayi);

                }

                else if (tSayi == rSayi)

                {

                    hak = --hak;

                    toolStripStatusLabel1.Text = "Tebrikler";

                    toolStripStatusLabel2.Text = "hakkınız kala bitirdiniz";

                    toolStripStatusLabel2.Text = hak.ToString() + " " + toolStripStatusLabel2;

                    comboBox1.Items.Add(tSayi);

                }



            }

            else

            {

                button1.Enabled = false;

                button2.Visible = true;



            }





        }



        private void button2_Click(object sender, EventArgs e)

        {

            b = "merih".ToString();

            a = Convert.ToString(comboBox1.Text);

            if (a == b)

            {

                hak = hak + 5;

                toolStripStatusLabel2.Text = "Kalan Hakkınız";

                toolStripStatusLabel2.Text = toolStripStatusLabel2 + " " + hak.ToString();

                button1.Enabled = true;

                button2.Visible = false;

            }

        }

    }

}
 
A Çevrimiçi

arturo3535

Kayıtlı Üye
25 Eylül 2012
39
0
6
36
yazılımın temel örneklerinden . kurstayken bizede yaptırıyorlardı yok at yarışı yok hesap makinası :)