using System;
using ;
using ponentModel;
using ;
using ;
using ;
using ;
using ;
namespace cs_nineplay
{
public partial class Form1 : Form
{
public Form1()
{
ponent();
}
Color OnColor = ;
Color OffColor = ;
int seconds1,seconds2=999;
int count1,count2=999;
int[,] ChangeCells ={{-1,-1,-1,-1,-1},
{1,2,4,5,-1},
{2,1,3,-1,-1},
{3,2,5,6,-1},
{4,1,7,-1,-1},
{5,2,4,6,8},
{6,3,9,-1,-1},
{7,4,5,8,-1},
{8,7,9,-1,-1},
{9,5,6,8,-1}
};
Button[] Buttons = new Button[10];
int num = 0;
//bool TF=true;
struct TM
{
public int Time, Times;
}
TM[] tm = new TM[100];
private void Button_Click(object sender, EventArgs e)
{
Button btnHit = (Button)sender;
int No = ();
for (int i = 0; i < 5; i++)
{
int X = ChangeCells[No, i];
if (X != -1)
{
if (Buttons[X].BackColor == OffColor)
Buttons[X].BackColor = OnColor;
else
Buttons[X].BackColor = OffColor;
}
}
count1 += 1;
= "次数:" + () + "次";
int sum = 0;
for (int i = 1; i <= 9; i++)
{
if (Buttons[i].BackColor == OnColor)
sum += 1;
}
if (sum == 8 && Buttons[5].BackColor == OffColor)
{
= true;
= false;
= false;
= "开始
C#九宫格游戏 来自淘豆网m.daumloan.com转载请标明出处.