猜大小游戏猜大小游戏
?Â?óÐ?ÓÎÏ?µÄºËÐÄ?úÂë?º
using System;
using System.Collections.Generic; using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace GuessApplication
{
public partial class Form1 : Form...
猜大小游戏
?Â?óÐ?ÓÎÏ?µÄºËÐÄ?úÂë?º
using System;
using System.Collections.Generic; using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace GuessApplication
{
public partial class Form1 : Form
{
private int a = 0;
private int b = 0;
private int c = 0;
private const int GUESS_NUM = 12;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
this.timer1.Enabled = true;
this.timer1.Interval = 50;
this.timer1.Start();
this.btn_stop.Enabled = true;
}
private void timer1_Tick(object sender, EventArgs e)
{
Random r = new Random();
a = r.Next(1,7);
b = r.Next(1,7);
c = r.Next(1,7);
this.num_1.Text = a.ToString();
this.num_2.Text = b.ToString();
this.num_3.Text = c.ToString();
}
private void btn_stop_Click(object sender, EventArgs e)
{
this.timer1.Stop();
this.timer1.Enabled = false;
this.btn_stop.Enabled = false;
int result = a + b + c;
if (result > GUESS_NUM)
{
if (this.r_big.Checked)
{
MessageBox.Show("??Ï?Äã?ð?ÔÁË???ó");
}
else
{
MessageBox.Show("ºÜ??Ç?Äã?ð?íÁË???ó");
}
}
else
{
if (this.r_small.Checked)
{
MessageBox.Show("??Ï?Äã?ð?ÔÁË??Ð?");
//jifen+100*1.0
}
else
{
MessageBox.Show("ºÜ??Ç?Äã?ð?íÁË??Ð?");
}
}
}
}
}
本文档为【猜大小游戏】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑,
图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。