• 第16周总结


    排球计分程序

    计划:大概花一周时间。用户故事:作为一个观众,我希望及时了解到比赛的比分情况。

     

    具体代码

    public partial class Form1 : Form
        {
              public Form1()
             {
                InitializeComponent();
                
               }
            int a = 1;
            int b = 1;
            int i = 1;
            private void btn_Click(object sender, EventArgs e)
            {
                int D1 = Convert.ToInt32(txtD1.Text);
                int D2 = Convert.ToInt32(txtD2.Text);
                int DD1 = Convert.ToInt32(txtDD1.Text);
                int DD2 = Convert.ToInt32(txtDD2.Text);
                txtD1.Text = (a++).ToString();
                if (D1 >= 24 && (D1 - D2) > 1)
                {
                    txtDD1.Text = (Convert.ToInt32(txtDD1.Text) + 1).ToString();
                    txtD1.Text = "0";
                    txtD2.Text = "0";
                    txtCount.Text += "第" + (i++) + "局:" + txtDD1.Text + ":" + txtDD2.Text + " ";
                    a = 1;
                    if (txtDD1.Text == "3")
                    {
                        MessageBox.Show("红队胜利");
                        txtD1.Text = "0";
                        txtDD1.Text = "0";
                        txtD2.Text = "0";
                        txtDD2.Text = "0";
                        txtCount.Clear();
                    }
                }
                if (DD1 + DD2 > 3)
                {
                    if (D1 >= 14 && (D1 - D2) > 1)
                    {
                        txtDD1.Text = (Convert.ToInt32(txtDD1.Text) + 1).ToString();
                        txtD1.Text = "0";
                        txtD2.Text = "0";
                        txtCount.Text += "第" + (i++) + "局:" + txtDD1.Text + ":" + txtDD2.Text + " ";
                        a = 1;
                        if (txtDD1.Text == "3")
                        {
                            MessageBox.Show("蓝队胜利");
                            txtD1.Text = "0";
                            txtDD1.Text = "0";
                            txtD2.Text = "0";
                            txtDD2.Text = "0";
                            txtCount.Clear();
                            i = 1;
                        }
                    }
                }
            }

            private void btn_Click(object sender, EventArgs e)
            {
                
                int D1 = Convert.ToInt32(txtD1.Text);
                int D2 = Convert.ToInt32(txtD2.Text);
                int DD1 = Convert.ToInt32(txtDD1.Text);
                int DD2 = Convert.ToInt32(txtDD2.Text);
                txtD2.Text = (b++).ToString();
                if (D2>= 24&&(D2-D1 )>1)
                {
                    txtDD2.Text = (Convert.ToInt32(txtDD2.Text) + 1).ToString();
                    txtD1.Text = "0";
                    txtD2.Text = "0";
                    txtCount.Text += "第" + (i++)+ "局:" + txtDD1.Text + ":" + txtDD2.Text + " ";
                    b= 1;
                    if (txtDD2.Text=="3")
                    {
                        MessageBox.Show("红队胜利");
                        txtD1.Text = "0";
                        txtDD1.Text = "0";
                        txtD2.Text = "0";
                        txtDD2.Text = "0";
                        txtCount.Clear();
                    }
                }
                if(DD1+DD2>3)
                {
                    if (D2 >= 14 && (D2 - D1) > 1)
                    {
                        txtDD2.Text = (Convert.ToInt32(txtDD2.Text) + 1).ToString();
                        txtD1.Text = "0";
                        txtD2.Text = "0";
                        txtCount.Text += "第" + (i++) + "局:" + txtDD1.Text + ":" + txtDD2.Text + " ";
                        b = 1;
                        if (txtDD2.Text == "3")
                        {
                            MessageBox.Show("蓝队胜利");
                            txtD1.Text = "0";
                            txtDD1.Text = "0";
                            txtD2.Text = "0";
                            txtDD2.Text = "0";
                            txtCount.Clear();
                            i = 1;
                        }
                    }
                }
               
            }

           
          
        }
    }

  • 相关阅读:
    20165208 2017-2018-2 《Java程序设计》第三周学习总结
    20165208 预备作业3 Linux安装及学习
    20155315 2016-2017-2《Java程序设计》课程总结
    20155315 2016-2017-2 《Java程序设计》第十周学习总结
    20155315 2016-2017-2 《Java程序设计》第九周学习总结
    20155315 2016-2017-2 《Java程序设计》第八周学习总结
    20155315 2016-2017-2 《Java程序设计》第七周学习总结
    2017-2018-2 20165330 实验四《Android程序设计》实验报告
    第十周课堂实践总结
    2017-2018-2 20165330 实验三《敏捷开发与XP实现》实验报告
  • 原文地址:https://www.cnblogs.com/pxt--1202b/p/6220361.html
Copyright © 2020-2023  润新知