衔接上一学期:排球积分规则

一、计划

          这个程序开发时间:两周。

 二、开发

      1、需求分析:

用户故事:作为一个教练,我希望了解每一场队友和对方的比赛加分和扣分细节,以及所有队员每一场的得分与排行情况,以便于更好的对队员做出战术安排。(精确到每一局的结果比分)。<队伍,比赛情况,比赛记录,数据库>

      2.设计文档:

赛制分析:

    以奥运会赛制为例:预选赛、小组赛、淘汰赛(四分之一)、半决赛、决赛。预选赛:选出十二支队伍小组赛:单循环赛制,选出以积分排名每组前4,进行八强淘汰,A、B两队A1vsB4,A4vsB1,剩余抽签配对。半决赛:A1/B4胜方VS  A2/B2(B3)胜方;A4vsB1胜方VS  A2/B3(B2)胜方。小组赛排名第6的并列第11名,第5的并列第9名,淘汰赛负方并列第5,。小组赛排名由总分决定。若平局。按获胜次数决定,按输赢比率决定,按得分比率决定,按最后一场获胜代表队排名靠前。

积分规则

 若为3:0或3:1,胜者得3分,负者不得分。若为3:2,胜者2分,负者1分。

中国队名单

主攻:2号朱婷、9号张常宁、12号惠若琪(队长)、10号刘晓彤

副攻:1号袁心玥、17号颜妮、11号徐云丽

接应:6号龚翔宇、3号杨方旭

二传:7号魏秋月、16号丁霞

自由人:15号林莉

 

塞尔维亚队名单

二传:10号奥杰年诺维奇(Ognjenovi?),兹维科维奇(?ivkovi?);

接应:布拉克塞维奇(Brako?evi?),19号博斯科维奇(Bo?kovi?);

主攻:9号米哈伊洛维奇(Mihajlovi?),尼克里奇(Nikoli?),6号马列舍维奇(Male?evi?),布萨(Bu?a);

副攻:16号拉西奇(Ra?i?),维利科维奇(Veljkovi?),15号斯塔瓦诺维奇(Stevanovi?);

自由人:17号波波维奇(Popovi?)。

    3.设计复审:

       由小组共同进行检查修改,提出建议,并进行相应的改进。

4.代码规范:

5.具体设计:

      6.代码具体如下:

      7.代码复审:

8.测试:

三、报告

          1.测试报告:

2.计算工作量:实际工作时间为6.5天。

3.事后总结与过程改进计划:

          时隔一个学期有点生疏,看了以前的相关书籍,并审查了上个学期的具体代码,然后有进行编码设计。整体感觉有点吃力,还是要多练习,多看代码,理解代码,才能更好驾驭代码,生成新代码。

private void lblIndex_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.Close();
            historySelect a = new historySelect();
            a.Show();
        }

private void begin_Click(object sender, EventArgs e)
        {
            if (textName.Text.Trim() == "" || Ateam.Text.Trim() == "" || Bteam.Text.Trim() == "")
            {
                MessageBox.Show("比赛名、队伍名均不能为空");
            }
            else
            {
                writeHistory1 w = new writeHistory1();
                w.bisai(textName.Text);
                w.TeamA(Ateam.Text);
                w.TeamB(Bteam.Text);
                w.Show();
                this.Close();
            }
            
        }

private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
           Application.Exit();
        }

计分界面:

int sA, sB;
        StringBuilder sb = new StringBuilder();
       
        public string bisai(string str)
        {
            return name.Text = str;
        }
        public void TeamA(string str)
        {
            teamA.Text = str;
        }
        public void TeamB(string str)
        {
            teamB.Text = str;
        }
        public void insert(string win) 
        {
            string sql = "insert into paiqiu(game,teamA,teamB,one,two,three,four,five,win,qiangqing) values(@game,@teamA,@teameB,@one,@two,@three,@four,@five,@win,@qiangqing)";
            SqlParameter[] sp = {
                                        new SqlParameter("@game",name.Text),
                                        new SqlParameter("@teamA",teamA.Text),
                                        new SqlParameter("@teameB",teamB.Text),
                                        new SqlParameter("@one",one),
                                        new SqlParameter("@two",two),
                                        new SqlParameter("@three",three),
                                        new SqlParameter("@four",four==null?DBNull.Value:(object)four),
                                        new SqlParameter("@five",five==null?DBNull.Value:(object)five),
                                        new SqlParameter("@win",win),
                                        new SqlParameter("@qiangqing",sb.ToString())
                                    };
            SqlHelper.ExecuteNonQuery(sql, sp);
        }
        public void insertPM( string team,int score,int chang,int ju)
        {
            string sql = "insert into paiming values(@game,@team,@score,@chang,@ju)";
            SqlParameter[] sp = {
                                    new SqlParameter("@game",name.Text),
                                    new SqlParameter("@team",team),
                                    new SqlParameter("@score",score),
                                    new SqlParameter("@chang",chang),
                                    new SqlParameter("@ju",ju)    
                                    };
            SqlHelper.ExecuteNonQuery(sql, sp);
        }
        public void update(string team, int score, int chang, int ju) 
        {
            string sql = "update paiming set [email protected],[email protected],[email protected] where [email protected]";
            SqlParameter[] sp = {
                                    new SqlParameter("@score",score),
                                    new SqlParameter("@chang",chang),
                                    new SqlParameter("@ju",ju),
                                    new SqlParameter("@team",team)
                                };
            SqlHelper.ExecuteNonQuery(sql, sp);
        }
        public void select(string team,int score,int chang,int ju) 
        {
            string sql = "select * from paiming where sname=‘"+name.Text.ToString()+"‘ and dname=‘"+team+"‘";
            SqlDataReader reader=SqlHelper.ExecuteReader(sql);
            if (reader.HasRows) 
            {
                while (reader.Read())
                {
                    int score0 = Convert.ToInt32(reader[2]) + score;
                    int chang0 = Convert.ToInt32(reader[3]) + chang;
                    int ju0 = Convert.ToInt32(reader[4]) + ju;
                    update(team, score0, chang0, ju0);
                }
            }
            else
            {
                insertPM(team, score, chang, ju);
            }
        }
        string one=null, two=null, three=null, four=null, five=null;

private void A_Click(object sender, EventArgs e)
        {
            int a=int.Parse(scoreA.Text) + 1;
            int b = int.Parse(scoreB.Text);
            sb.AppendFormat("{0}:{1}={2}:{3}\r\n", teamA.Text, teamB.Text, a, b);
            
            int i=Convert.ToInt32( lblNum.Text.Substring(1, 1));
            int sa = Convert.ToInt32(lblA.Text);
            scoreA.Text = a.ToString();
            if (i < 5)
            {
                if (a >= 25 && a - b >= 2)
                {
                    string str = string.Format("本局甲方:{0}胜", teamA.Text);
                    MessageBox.Show(str);
                    scoreA.Text = "0";
                    scoreB.Text = "0";
                    sa++; i++;
                    lblA.Text = (sa).ToString();
                    lblNum.Text = "第" + i + "局";
                    sb.AppendFormat("第{0}局  {1}:{2}={3}:{4}  本局{5}胜\r\n", i - 1, teamA.Text, teamB.Text, a, b, teamA.Text);
                    switch(i-1)
                    {
                        case 1:one=string.Format("{0}:{1}",a,b); break;
                        case 2:two=string.Format("{0}:{1}",a,b); break;
                        case 3:three=string.Format("{0}:{1}",a,b); break;
                        case 4:four=string.Format("{0}:{1}",a,b); break;
                    }
                }
            }
            else 
            {
                if(a>=15&&a-b>=2)
                {
                    sb.AppendFormat("第{0}局  {1}:{2}={3}:{4}  本局{5}胜\r\n", i - 1, teamA.Text, teamB.Text, a, b, teamA.Text);
                    string str = string.Format("本局甲方:{0}胜", teamA.Text);
                    MessageBox.Show(str);
                    sa++;
                    lblA.Text = (sa).ToString();
                    five=string.Format("{0}:{1}",a,b);
                }
            }
            if (sa == 3) {
                sb.AppendFormat("本场比赛甲方:{0}胜\r\n比赛结束",teamA.Text);
                string str=string.Format("本场比赛{0}胜",teamA.Text);
                win.Text = str;
                win.Visible = true;
                A.Visible = false;
                B.Visible = false;
                insert(teamA.Text);
                if (lblB.Text == "2") { sA = 2; sB = 1; }
                else { sA = 3; sB = 0; }
                select(teamA.Text.ToString(),sA,1,sa);
                select(teamB.Text.ToString(), sB, 0, Convert.ToInt32(lblB.Text));
            }
            textBox1.Text = sb.ToString();
        }
        
        private void B_Click(object sender, EventArgs e)
            int a = int.Parse(scoreB.Text) + 1;
            int b = int.Parse(scoreA.Text);
            sb.AppendFormat("{0}:{1}={2}:{3}\r\n", teamA.Text, teamB.Text, b, a);
            
            int i = Convert.ToInt32(lblNum.Text.Substring(1, 1));
            int sa = Convert.ToInt32(lblB.Text);
            scoreB.Text =a.ToString();
            if (i < 5)
            {
                if (a >= 25 && a - b >= 2)
                {
                    string str = string.Format("本局乙方:{0}胜",teamB.Text);
                    MessageBox.Show(str);
                    scoreA.Text = "0";
                    scoreB.Text = "0";
                    sa++; i++;
                    lblB.Text = (sa).ToString();
                    lblNum.Text = "第" + i + "局";
                    sb.AppendFormat("第{0}局  {1}:{2}={3}:{4}  本局{5}胜\r\n", i - 1, teamA.Text, teamB.Text, b, a, teamB.Text);
                    switch (i - 1)
                    {
                        case 1: one = string.Format("{0}:{1}", b, a); break;
                        case 2: two = string.Format("{0}:{1}", b, a); break;
                        case 3: three = string.Format("{0}:{1}", b, a); break;
                        case 4: four = string.Format("{0}:{1}", b, a); break;
                    }
                }
            }
            else
            {
                if (a >= 15 && a - b >= 2)
                {
                    sb.AppendFormat("第{0}局  {1}:{2}={3}:{4}  本局{5}胜\r\n", i-1,teamA.Text,teamB.Text ,b, a,teamB.Text);
                    string str = string.Format("本局乙方:{0}胜", teamB.Text);
                    MessageBox.Show(str);
                    sa++;
                    lblB.Text = (sa).ToString();
                    five = string.Format("{0}:{1}", b, a);
                }
            }
            if (sa == 3) {
                sb.AppendFormat("本场比赛乙方:{0}胜\r\n比赛结束", teamB.Text);
                string str = string.Format("本场比赛{0}胜", teamB.Text);
                win.Text = str;
                win.Visible = true;
                A.Visible = false;
                B.Visible = false;
                insert(teamB.Text);
                if (lblA.Text == "2") { sB = 2; sA = 1; }
                else { sB = 3; sA = 0; }
                select(teamB.Text.ToString(), sB, 1, sa);
                select(teamA.Text.ToString(), sA, 0, Convert.ToInt32(lblA.Text));
            }
            textBox1.Text = sb.ToString();
        }

private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (textBox1.Visible == false)
            {
                textBox1.Visible = true;
            }
            else 
            {
                textBox1.Visible = false;
            }
        }

private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.Close();
            writeHistory0 a = new writeHistory0();
            a.Show();
          
        }

private void Form1_Load(object sender, EventArgs e)
        {
            sb.AppendFormat("比赛名称:{0}\r\n甲方:{1}  乙方:{2}\r\n",name.Text, teamA.Text, teamB.Text);
            textBox1.Text = sb.ToString();
        }

private void lblIndex_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.Close();
            historySelect a = new historySelect();
            a.Show();
        }

private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Application.Exit();
        }

private void btn1_Click(object sender, EventArgs e)
        {
            int a = int.Parse(scoreA.Text);
            int b = int.Parse(scoreB.Text);
            if (a > 0)
            {
                a--;
                scoreA.Text = a.ToString();
                sb.AppendFormat("比赛受到争议:甲方减分\r\n{0}:{1}={2}:{3}\r\n", teamA.Text, teamB.Text, a, b);
                textBox1.Text = sb.ToString();
            }
            else 
            {
                MessageBox.Show("操作失败");
            }
        }

private void btn2_Click(object sender, EventArgs e)
        {
            int a = int.Parse(scoreA.Text);
            int b = int.Parse(scoreB.Text);
            if (b > 0)
            {
                b--;
                scoreB.Text = b.ToString();
                sb.AppendFormat("比赛受到争议:乙方减分\r\n{0}:{1}={2}:{3}\r\n", teamA.Text, teamB.Text, a, b);
                textBox1.Text = sb.ToString();
            }
            else
            {
                MessageBox.Show("操作失败");
            }
        }

比赛记录查询:

private void cmbLoad()
        {
            cmbName.Items.Clear();

string sql = "select game from paiqiu";
            SqlDataReader reader = SqlHelper.ExecuteReader(sql);
            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    cmbName.Items.Add(reader[0]);
                }
            }
            reader.Close();
        }
        private void dgvLoad()
        {
            string sql = "select * from paiqiu";
            dgvGame.DataSource = SqlHelper.ExecuteDataTable(sql);
        }
        private void Form2_Load(object sender, EventArgs e)
        {
            cmbLoad();
            dgvLoad();
            
        }

private void select_Click(object sender, EventArgs e)
        {
            StringBuilder sql = new StringBuilder("select * from paiqiu where 1=1");
            if (!string.IsNullOrEmpty(cmbName.Text))
            {
                sql.Append(" and game like ‘%" + cmbName.Text + "%‘");
            }
            SqlDataReader reader= SqlHelper.ExecuteReader(sql.ToString());
            if (reader.HasRows)
            {
                dgvGame.DataSource = SqlHelper.ExecuteDataTable(sql.ToString());
            }
            else 
            {
                MessageBox.Show("没有查询到比赛记录!");
            }
        }

private void lblWrite_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.Close();
            writeHistory0 a = new writeHistory0();
            a.Show();
        }

private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
             Application.Exit();
        }

private void dgvGame_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int x = e.ColumnIndex;
            int y = e.RowIndex;
            if(x==0&&y!=-1)
            {
                child ch = new child();
                ch.xq(dgvGame.CurrentRow.Cells[11].Value.ToString());
                ch.Show();
            }

}

private void button1_Click(object sender, EventArgs e)
        {
            selectPM sp = new selectPM();
            sp.Show();
        }

比赛排名查询:

private void selectPM_Load(object sender, EventArgs e)
        {
            string sql = "select * from paiming";
            dgvPM.DataSource = SqlHelper.ExecuteDataTable(sql);
            for (int i =1 ; i < dgvPM.Rows.Count+1 ; i++)
            {
                dgvPM.Rows[i-1].Cells["ranking"].Value = i;
            }
        }

private void dgvPM_Sorted(object sender, EventArgs e)
        {
            for (int i = 1; i < dgvPM.Rows.Count + 1; i++)
            {
                dgvPM.Rows[i - 1].Cells["ranking"].Value = i;
            }
        }

时间: 2024-10-27 00:43:36

衔接上一学期:排球积分规则的相关文章

排球积分规则功能说明书(spec)

排球规则: 由技术性规定.非技术性规定和场地设备要求等方面的内容组成的.每场比赛仍为五局三胜,前四局每局先得25分为胜,第五局先得15分者为胜.当出现24平或14平时,要继续比赛至领先2分才能取胜. 球成功的落在对方场区:对方犯规:对方受到判罚:如果两个或更多队员同时犯规先后发生,只判第一犯规:两队同时犯规,判"双方犯规",该球重新比赛:如果2:2平时,决胜局(第五局)打至15分并领先对方2分者获胜:弃权与阵容不完整未到比赛场地弃权:拒绝比赛弃权:当发球员不在正确位置上则构成位置错误犯

排球积分规则

排球比赛计分规则为:目前的排球比赛采用五局三胜制.前四局每局25分,每局比赛完成后交换场地,达到24分时,必须比赛的双方相差2分才能分出胜负:决胜局为15分,比赛的双方任何一方先达到8分时,交换场地继续比赛,当双方同时达到14分时候,也是必须相差两分才能决出胜负.排球计分的发展历程:1917年规定每局为15分.1918年规定上场运动员每队为6人.1922年规定每方必须在3次以内将球击过网.比赛方法以前采用发球得分制,1998年10月28日国际排联决定改为每球得分制,仍为五局三胜,前四局每局先得2

排球计分规则小结

排球比赛计分规则为:目前的排球比赛采用五局三胜制.前四局每局25分,每局比赛完成后交换场地,达到24分时,必须比赛的双方相差2分才能分出胜负:决胜局为15分,比赛的双方任何一方先达到8分时,交换场地继续比赛,当双方同时达到14分时候,也是必须相差两分才能决出胜负.排球计分的发展历程:1917年规定每局为15分.1918年规定上场运动员每队为6人.1922年规定每方必须在3次以内将球击过网.比赛方法以前采用发球得分制,1998年10月28日国际排联决定改为每球得分制,仍为五局三胜,前四局每局先得2

排球计分规则程序说明书

需要完成的目标: 通过程序说明书,更好的更直观的了解排球计分规则.并且使比分程序化,更好的完成现代化进程. 用户: 喜欢排球的观众.裁判员.教练及运动员. 典型场景: 2016里约热内卢夏季奥运会女排总决赛中国女排对阵塞尔维亚女排. 专业术语: 反攻 排球运动四次的一种.指后排防起对方攻来之球以后所组织的反击,和在网上直接拦击对方各种进攻.是得分的主要手段.在比赛中出现次数最多,难度也最大.其过程包括:拦网.后排防守.调整二传和扣球等几个相互衔接的部分.其中拦网是第一道防线,后排防守是反攻的基础

排球积分程序(二)——需求分析

不啰嗦,直接进入需求分析环节. 需求分析: 这个项目是一个排球积分程序,可以把功能分为两部分,一是积分,另一部分是查积分. 一:积分: 1.首先介绍排球比赛积分规则排球比赛采用五局三胜制,胜三局的队胜一场.前四局每局25分第五局15分.比赛中,某队胜1球,即得1分(每球得分制).接发球队胜1球时得1分,同时获得发球权,队员按顺时针方向轮转一个位置.每局比赛(决胜局第五局除外)先得25分并同时领先对手2分的队胜一局.当比分为24∶24时,比赛继续进行至某队领先2分(26∶24.27∶25)为止.决

排球计分规则

排球计分软件是方便的计分软件. 首先要十分了解排球计分规则,制作软件需要那些因素.要有双方的每球得分,每场得分和总得分. 按照排球比赛的规则进行计分,排球规则为五局三胜制.除决胜局每局比赛25分,每局比赛完成后交换场地,如果两队都达到24分时,比赛双方相差2分才能分出胜负:决胜局则是15分,任何一方达到8分时交换场地,都达到14分,还是要相差2分才能分出胜负. 软件根据两对得分情况进行计分,每胜一球就得一分,如果有一队胜了两场那么接下来一局就就按决胜局进行计分. 做出来之后就是要测试了,然后发现

暑假对排球计分规则的更新

需求: 作为观众,我想知道比赛进行时的队伍比分和比赛结束时的队伍输赢 运行图: 代码如下: 查看比赛队伍 1 public class UpdateController : Controller 2 { 3 private 排球计分规则Context db = new 排球计分规则Context(); 4 5 // 6 // GET: /Update/ 7 8 public ActionResult Index() 9 { 10 return View(db.Updates.ToList());

第六组排球计分规则小组作业

计划   估计这个任务所需时间 300min 开发   分析需求 70min 生成设计文档 40min 代码规范 30min 具体设计 100min 具体编码 120min 测试 20min 记录用时 4h 计算工作量 无 事后总结以及改进计划 30 排球计分规则界面设计: 部分代码:

开源 免费 java CMS - FreeCMS1.9 积分规则管理

项目地址:http://www.freeteam.cn/ 积分规则管理 管理会员操作时积分处理规则. 1. 积分规则管理 从左侧管理菜单点击积分规则进入. 2. 添加积分规则 在积分规则列表下方点击"添加"按钮. 填写相关属性后点击"确定"按钮即可. 3. 编辑积分规则 选择需要编辑的积分规则,然后点击"编辑"按钮. 注意:同时只能编辑一个积分规则. 填写相关属性后点击"确定"按钮即可. 4. 删除积分规则 选择需要删除的积分