当前位置: 首页 > news >正文

排球比赛积分规则---三层架构

估计这个任务需要多少时间:3天

 需求分析:0.5h

 用户故事:作为一名现场记分员,我希望详细记录比赛现场比分增长情况,以便观众及运动员、教练员及时掌握比赛状况。

 生成设计文档3h

 设计复审(和同事审核设计文档)0.5h

 代码规范(为目前的开发制定合适的规范)

 具体代码:3h

代码具体如下:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace 排球计分程序
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            
        }
        int a = 1;
        int b = 1;
        int i = 1;
        private void btnD1_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 + "\r\n";
                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 + "\r\n";
                    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 btnD2_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 + "\r\n";
                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 + "\r\n";
                    b = 1;
                    if (txtDD2.Text == "3")
                    {
                        MessageBox.Show("二队胜利");
                        txtD1.Text = "0";
                        txtDD1.Text = "0";
                        txtD2.Text = "0";
                        txtDD2.Text = "0";
                        txtCount.Clear();
                        i = 1;
                    }
                }
            }
           
        }

       
      
    }

转载于:https://www.cnblogs.com/zhang123456789/p/6569077.html

相关文章:

  • [译] 看动画,学 RxJS
  • (zhuan) 一些RL的文献(及笔记)
  • java 的底层通信--Socket
  • java.util.concurrent.CountDownLatch用方法
  • PSI分析
  • Hibernate JPA中@Transient、@JsonIgnoreProperties、@JsonIgnore、@JsonFormat、@JsonSerialize等注解解释...
  • maven的基本原理和使用
  • cocos2d-x -Lua 字符串
  • [系统资源攻略]IO第一篇-磁盘IO,内核IO概念
  • 深入理解CSS中的margin
  • 有哪些話让你看了一遍就再也没有忘记?
  • 搭建nlp_server服务器
  • 修身
  • android classloader双亲委托模式
  • 手机号中间四位加星号
  • “Material Design”设计规范在 ComponentOne For WinForm 的全新尝试!
  • 【Leetcode】104. 二叉树的最大深度
  • 〔开发系列〕一次关于小程序开发的深度总结
  • eclipse的离线汉化
  • GitUp, 你不可错过的秀外慧中的git工具
  • gops —— Go 程序诊断分析工具
  • Iterator 和 for...of 循环
  • JAVA SE 6 GC调优笔记
  • Js实现点击查看全文(类似今日头条、知乎日报效果)
  • mysql中InnoDB引擎中页的概念
  • SegmentFault 2015 Top Rank
  • 海量大数据大屏分析展示一步到位:DataWorks数据服务+MaxCompute Lightning对接DataV最佳实践...
  • 精彩代码 vue.js
  • 设计模式走一遍---观察者模式
  • 微信如何实现自动跳转到用其他浏览器打开指定页面下载APP
  • 正则表达式
  • Oracle Portal 11g Diagnostics using Remote Diagnostic Agent (RDA) [ID 1059805.
  • MPAndroidChart 教程:Y轴 YAxis
  • Salesforce和SAP Netweaver里数据库表的元数据设计
  • 积累各种好的链接
  • (env: Windows,mp,1.06.2308310; lib: 3.2.4) uniapp微信小程序
  • (java版)排序算法----【冒泡,选择,插入,希尔,快速排序,归并排序,基数排序】超详细~~
  • (Matalb分类预测)GA-BP遗传算法优化BP神经网络的多维分类预测
  • (附源码)springboot社区居家养老互助服务管理平台 毕业设计 062027
  • (过滤器)Filter和(监听器)listener
  • (学习日记)2024.04.04:UCOSIII第三十二节:计数信号量实验
  • (一)Spring Cloud 直击微服务作用、架构应用、hystrix降级
  • .net framework4与其client profile版本的区别
  • .net 中viewstate的原理和使用
  • @html.ActionLink的几种参数格式
  • @Pointcut 使用
  • [2024最新教程]地表最强AGI:Claude 3注册账号/登录账号/访问方法,小白教程包教包会
  • [ABC294Ex] K-Coloring
  • [ASP.NET MVC]如何定制Numeric属性/字段验证消息
  • [Bugku]密码???[writeup]
  • [C/C++]_[初级]_[关于编译时出现有符号-无符号不匹配的警告-sizeof使用注意事项]
  • [C++]拼图游戏
  • [CareerCup] 14.5 Object Reflection 对象反射
  • [CF226E]Noble Knight's Path
  • [HDOJ4911]Inversion