اذهب إلى المحتوى

AM0

الأعضاء
  • المساهمات

    22
  • تاريخ الانضمام

  • تاريخ آخر زيارة

أجوبة بواسطة AM0

  1. اكوادي هذي كنت ابغا احط قائمه فيها العب من جديد او مو شرط قائمه بس ابغا اضغط ويخلي الللعبه تنعاد يعني ابغا شيفره تعيد لي اللعبه 

    هذي الاكواد 

     public partial class Form1 : Form
        {
            int count = 0;
            public Form1()
            {
                InitializeComponent();
            }
     
            private void winner()
            {
    
                if ((button1.Text == button2.Text) && (button1.Text == button3.Text) && button1.Text!="")
                {
                    if (count % 2 == 0)
                    {
                        MessageBox.Show("Player 1 is the winner");
                        Application.Exit();
                    }
                    else
                    {
                        MessageBox.Show("Player 2 is the winner");
                        Application.Exit();
                    }
    
                }
                if ((button4.Text == button5.Text) && (button4.Text == button6.Text) && button4.Text != "")
                {
                    if (count % 2 == 0)
                    {
                        MessageBox.Show("Player 1 is the winner");
                        Application.Exit();
                    }
                    else
                    {
                        MessageBox.Show("Player 2 is the winner");
                        Application.Exit();
                    }
    
                }
                if ((button7.Text == button8.Text) && (button8.Text == button9.Text) && button7.Text != "")
                {
                    if (count % 2 == 0)
                    {
                        MessageBox.Show("Player 1 is the winner");
                        Application.Exit();
                    }
                    else
                    {
                        MessageBox.Show("Player 2 is the winner");
                        Application.Exit();
                    }
    
                }
                if ((button1.Text == button4.Text) && (button4.Text == button7.Text) && button1.Text != "")
                {
                    if (count % 2 == 0)
                    {
                        MessageBox.Show("Player 1 is the winner");
                        Application.Exit();
                    }
                    else
                    {
                        MessageBox.Show("Player 2 is the winner");
                        Application.Exit();
                    }
    
                }
                if ((button2.Text == button5.Text) && (button2.Text == button8.Text) && button2.Text != "")
                {
                    if (count % 2 == 0)
                    {
                        MessageBox.Show("Player 1 is the winner");
                        Application.Exit();
                    }
                    else
                    {
                        MessageBox.Show("Player 2 is the winner");
                        Application.Exit();
                    }
    
                }
                if ((button3.Text == button6.Text) && (button3.Text == button9.Text) && button3.Text != "")
                {
                    if (count % 2 == 0)
                    {
                        MessageBox.Show("Player 1 is the winner");
                        Application.Exit();
                    }
                    else
                    {
                        MessageBox.Show("Player 2 is the winner");
                        Application.Exit();
                    }
    
                }
                if ((button1.Text == button5.Text) && (button1.Text == button9.Text) && button1.Text != "")
                {
                    if (count % 2 == 0)
                    {
                        MessageBox.Show("Player 1 is the winner");
                        Application.Exit();
                    }
                    else
                    {
                        MessageBox.Show("Player 2 is the winner");
                        Application.Exit();
                    }
    
                }
                if ((button3.Text == button5.Text) && (button3.Text == button7.Text) && button3.Text != "")
                {
                    if (count % 2 == 0)
                    {
                        MessageBox.Show("Player 1 is the winner");
                        Application.Exit();
                    }
                    else
                    {
                        MessageBox.Show("Player 2 is the winner");
                        Application.Exit();
                    }
    
                }
    
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
                if (count % 2==0)
                {
                    button1.Text = "O";
                    button1.Enabled = false;
                    winner();
                    count++;
                }
                else
                {
    
                    button1.Text = "X";
                    button1.Enabled = false;
                    winner();
                    count++;
                }
            }
    
            private void button2_Click(object sender, EventArgs e)
            {
    
                if (count % 2 == 0)
                {
                    button2.Text = "O";
                    button2.Enabled = false;
                    winner();
                    count++;
                }
                else
                {
    
                    button2.Text = "X";
                    button2.Enabled = false;
                    winner();
                    count++;
                }
            }
    
            private void button3_Click(object sender, EventArgs e)
            {
    
                if (count % 2 == 0)
                {
                    button3.Text = "O";
                    button3.Enabled = false;
                    winner();
                    count++;
                }
                else
                {
    
                    button3.Text = "X";
                    button3.Enabled = false;
                    winner();
                    count++;
                }
            }
    
            private void button4_Click(object sender, EventArgs e)
            {
    
                if (count % 2 == 0)
                {
                    button4.Text = "O";
                    button4.Enabled = false;
                    winner();
                    count++;
                }
                else
                {
    
                    button4.Text = "X";
                    button4.Enabled = false;
                    winner();
                    count++;
                }
            }
    
            private void button5_Click(object sender, EventArgs e)
            {
    
                if (count % 2 == 0)
                {
                    button5.Text = "O";
                    button5.Enabled = false;
                    winner();
                    count++;
                }
                else
                {
    
                    button5.Text = "X";
                    button5.Enabled = false;
                    winner();
                    count++;
                }
            }
    
            private void button6_Click(object sender, EventArgs e)
            {
    
                if (count % 2 == 0)
                {
                    button6.Text = "O";
                    button6.Enabled = false;
                    winner();
                    count++;
                }
                else
                {
    
                    button6.Text = "X";
                    button6.Enabled = false;
                    winner();
                    count++;
                }
            }
    
            private void button7_Click(object sender, EventArgs e)
            {
    
                if (count % 2 == 0)
                {
                    button7.Text = "O";
                    button7.Enabled = false;
                    winner();
                    count++;
                }
                else
                {
    
                    button7.Text = "X";
                    button7.Enabled = false;
                    winner();
                    count++;
                }
            }
    
            private void button8_Click(object sender, EventArgs e)
            {
    
                if (count % 2 == 0)
                {
                    button8.Text = "O";
                    button8.Enabled = false;
                    winner();
                    count++;
                }
                else
                {
    
                    button8.Text = "X";
                    button8.Enabled = false;
                    winner();
                    count++;
                }
            }
    
            private void button9_Click(object sender, EventArgs e)
            {
    
                if (count % 2 == 0)
                {
                    button9.Text = "O";
                    button9.Enabled = false;
                    winner();
                    count++;
                }
                else
                {
    
                    button9.Text = "X";
                    button9.Enabled = false;
                    winner();
                    count++;
                }
            }
        }

     

    • أعجبني 1
  2. كيف انشئ داله باسم RepeatString() بحيث تستقبل متغيرين المتغير الاول جمله نصيه (str) والمتغير الثاني (n) تقوم هذه الداله بتكرار الجمله str عدد n من المرات ثم تقوم بطباعة الجمله المكرره على شاشة console 

    مثال اذا كانت Str= Hello وكررناها 3 مرات تكون بالمخرجات كالتالي 

    HelloHelloHello

    • أعجبني 1
  3. ابغا فكره بسيطه جداً جداً ل مشروع برمجي ابلكيشن ويندوز يعني زي الاله الحاسبه وكذا وكتابة الاكواد تكون في الدوال والبرمجه الشيئيه ،المصفوفات، الوراثه والكبسله ، تعدد الاشكال من هذي المواضيع لقيت اكثر من فكره لاكن كانت تحتاج وقت طويل مني

×
×
  • أضف...