示例#1
0
        private void PlayGame(string fist)
        {
            Player p            = new Player();//创建玩家对象
            int    PlayerNumber = p.ChuQuan(fist);

            lblPlayer.Text = fist;

            //创建电脑对象
            Computer cpu            = new Computer();
            int      ComputerNumber = cpu.ChuQuan();

            //将电脑出的拳赋值给lblCpu
            lblCpu.Text = cpu.Fist;

            //创建裁判对象
            CaiPan cp  = new CaiPan();
            Result res = cp.GetResult(PlayerNumber, ComputerNumber);

            lblResult.Text = res.ToString();
        }
示例#2
0
文件: Form1.cs 项目: HKX9110/HKX
        private void PlayGame(string fist)
        {
            //创建玩家对象
            Play play       = new Play();
            int  playNumber = play.ChuQuan(fist);

            this.lblPlay.Text = fist;

            //创建电脑对象
            Computer cpu       = new Computer();
            int      cpuNumber = cpu.ChuQuan();

            this.lblCpu.Text = cpu.Fist.ToString();

            //创建裁判对象
            CaiPan caipan = new CaiPan();
            Result res    = caipan.GetResult(playNumber, cpuNumber);

            this.lblResult.Text = res.ToString();
        }