2015年5月29日 星期五
2015年5月9日 星期六
智慧推盤 完成品
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.Random;
class Test
{
public static int num[] = new int[42];
public static int numl = 16;
public static int chosenum[] = new int[2];
public static int chosenumno = 0;
public static int chosebtID = 0;
public static int chose = 0;
public static Boolean first = false;
public static void main(String[] args)
{
JFrame jtfMainFrame = new JFrame("Which Button Demo");
jtfMainFrame.setSize(450, 150);
JPanel jplPanel = new JPanel();
int i;
int num1 , num2;
//if(first == false){
for( i = 0 ;i<16;i++){
num[i] = i+1;
}
//first = true;
//}
JButton jbnButton[] = new JButton[16];
int buttonNum[] = new int[16];
jplPanel.setLayout (new GridLayout(4, 4));
for(i = 0;i<=15;i++){
Random ran = new Random();
chose = ran.nextInt(numl);
if(num[chose] == 16)
jbnButton[i]=new JButton("");
else
jbnButton[i]=new JButton(""+num[chose]);
buttonNum[i] = num[chose];
jplPanel.add(jbnButton[i]);
for(int j = chose ;j<numl;j++){
num[j] = num[j+1];
}
numl--;
System.out.println(numl);
jbnButton[i].addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
int i;
Boolean canmove = false;
Boolean GameOver = false;
int canmoveID = 0;
for( i=0; i<jbnButton.length; i++){
if(e.getSource() == jbnButton[i]){
/*if(chosenumno == 0){
chosenum[chosenumno] = buttonNum[i];
chosebtID = i;
chosenumno++;
}
else{
chosenum[chosenumno] = buttonNum[i];
buttonNum[chosebtID] = chosenum[chosenumno];
buttonNum[i] = chosenum[chosenumno-1];
if(buttonNum[i] == 16)
jbnButton[i].setText("");
else
jbnButton[i].setText(""+buttonNum[i]);
if(buttonNum[chosebtID] == 16)
jbnButton[chosebtID].setText("");
else
jbnButton[chosebtID].setText(""+buttonNum[chosebtID]);
chosenumno = 0;
}*/
if(i-1>=0 && canmove == false){
if(buttonNum[i-1] == 16){
buttonNum[i-1] = buttonNum[i];
buttonNum[i] = 16;
jbnButton[i-1].setText(""+buttonNum[i-1]);
jbnButton[i].setText("");
canmove = true;
}
}
if(i-4>=0 && canmove == false){
if(buttonNum[i-4] == 16){
buttonNum[i-4] = buttonNum[i];
buttonNum[i] = 16;
jbnButton[i-4].setText(""+buttonNum[i-4]);
jbnButton[i].setText("");
canmove = true;
}
}
if(i+1<=15 && canmove == false){
if(buttonNum[i+1] == 16){
buttonNum[i+1] = buttonNum[i];
buttonNum[i] = 16;
jbnButton[i+1].setText(""+buttonNum[i+1]);
jbnButton[i].setText("");
canmove = true;
}
}
if(i+4>=0 && canmove == false){
if(buttonNum[i+4] == 16){
buttonNum[i+4] = buttonNum[i];
buttonNum[i] = 16;
jbnButton[i+4].setText(""+buttonNum[i+4]);
jbnButton[i].setText("");
canmove = true;
}
}
for(int j = 0 ; j<16; j++){
if(buttonNum[j] != j+1)
break;
else if(j == 15 && buttonNum[j] == 16){
JFrame jtfMainFrame1 = new JFrame("WIN");
jtfMainFrame1.setSize(450, 150);
JPanel jplPanel1 = new JPanel();
jtfMainFrame1.getContentPane().add(jplPanel1, BorderLayout.CENTER);
jtfMainFrame1.setVisible(true);
}
}
canmove = false;
}
}
}
});
}
jtfMainFrame.getContentPane().add(jplPanel, BorderLayout.CENTER);
jtfMainFrame.setVisible(true);
//System.out.print("Yang");
}
}
import java.awt.event.*;
import javax.swing.*;
import java.util.Random;
class Test
{
public static int num[] = new int[42];
public static int numl = 16;
public static int chosenum[] = new int[2];
public static int chosenumno = 0;
public static int chosebtID = 0;
public static int chose = 0;
public static Boolean first = false;
public static void main(String[] args)
{
JFrame jtfMainFrame = new JFrame("Which Button Demo");
jtfMainFrame.setSize(450, 150);
JPanel jplPanel = new JPanel();
int i;
int num1 , num2;
//if(first == false){
for( i = 0 ;i<16;i++){
num[i] = i+1;
}
//first = true;
//}
JButton jbnButton[] = new JButton[16];
int buttonNum[] = new int[16];
jplPanel.setLayout (new GridLayout(4, 4));
for(i = 0;i<=15;i++){
Random ran = new Random();
chose = ran.nextInt(numl);
if(num[chose] == 16)
jbnButton[i]=new JButton("");
else
jbnButton[i]=new JButton(""+num[chose]);
buttonNum[i] = num[chose];
jplPanel.add(jbnButton[i]);
for(int j = chose ;j<numl;j++){
num[j] = num[j+1];
}
numl--;
System.out.println(numl);
jbnButton[i].addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
int i;
Boolean canmove = false;
Boolean GameOver = false;
int canmoveID = 0;
for( i=0; i<jbnButton.length; i++){
if(e.getSource() == jbnButton[i]){
/*if(chosenumno == 0){
chosenum[chosenumno] = buttonNum[i];
chosebtID = i;
chosenumno++;
}
else{
chosenum[chosenumno] = buttonNum[i];
buttonNum[chosebtID] = chosenum[chosenumno];
buttonNum[i] = chosenum[chosenumno-1];
if(buttonNum[i] == 16)
jbnButton[i].setText("");
else
jbnButton[i].setText(""+buttonNum[i]);
if(buttonNum[chosebtID] == 16)
jbnButton[chosebtID].setText("");
else
jbnButton[chosebtID].setText(""+buttonNum[chosebtID]);
chosenumno = 0;
}*/
if(i-1>=0 && canmove == false){
if(buttonNum[i-1] == 16){
buttonNum[i-1] = buttonNum[i];
buttonNum[i] = 16;
jbnButton[i-1].setText(""+buttonNum[i-1]);
jbnButton[i].setText("");
canmove = true;
}
}
if(i-4>=0 && canmove == false){
if(buttonNum[i-4] == 16){
buttonNum[i-4] = buttonNum[i];
buttonNum[i] = 16;
jbnButton[i-4].setText(""+buttonNum[i-4]);
jbnButton[i].setText("");
canmove = true;
}
}
if(i+1<=15 && canmove == false){
if(buttonNum[i+1] == 16){
buttonNum[i+1] = buttonNum[i];
buttonNum[i] = 16;
jbnButton[i+1].setText(""+buttonNum[i+1]);
jbnButton[i].setText("");
canmove = true;
}
}
if(i+4>=0 && canmove == false){
if(buttonNum[i+4] == 16){
buttonNum[i+4] = buttonNum[i];
buttonNum[i] = 16;
jbnButton[i+4].setText(""+buttonNum[i+4]);
jbnButton[i].setText("");
canmove = true;
}
}
for(int j = 0 ; j<16; j++){
if(buttonNum[j] != j+1)
break;
else if(j == 15 && buttonNum[j] == 16){
JFrame jtfMainFrame1 = new JFrame("WIN");
jtfMainFrame1.setSize(450, 150);
JPanel jplPanel1 = new JPanel();
jtfMainFrame1.getContentPane().add(jplPanel1, BorderLayout.CENTER);
jtfMainFrame1.setVisible(true);
}
}
canmove = false;
}
}
}
});
}
jtfMainFrame.getContentPane().add(jplPanel, BorderLayout.CENTER);
jtfMainFrame.setVisible(true);
//System.out.print("Yang");
}
}
2015年5月8日 星期五
第七周 按鈕名稱亂數不重複
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.Random;
class Test
{
public static int num[] = new int[42];
public static int numl = 16;
public static int numno = 0;
public static int chose = 0;
public static Boolean first = false;
public static void main(String[] args)
{
JFrame jtfMainFrame = new JFrame("Which Button Demo");
jtfMainFrame.setSize(450, 150);
JPanel jplPanel = new JPanel();
int i;
int j=1;
int num1 , num2;
//if(first == false){
for( i = 0 ;i<16;i++){
num[i] = i+1;
}
//first = true;
//}
JButton jbnButton[] = new JButton[16];
JButton changeButton[] = new JButton[2];
jplPanel.setLayout (new GridLayout(4, 4));
for(i = 0;i<=15;i++){
jbnButton[i]=new JButton("Button"+(i+1));
jplPanel.add(jbnButton[i]);
String s = Integer.toString(i+1);
jbnButton[i].addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Random ran = new Random();
chose = ran.nextInt(numl);
System.out.println(chose);
int i;
for( i=0; i<jbnButton.length; i++){
if(e.getSource() == jbnButton[i]){
jbnButton[i].setText(""+num[chose]);
}
}
for(i = chose ;i<numl;i++){
num[i] = num[i+1];
//System.out.println(num[chose]);
}
numl--;
System.out.println(numl);
for(i = 0 ;i<numl;i++){
//System.out.println(num[i]);
}
}
});
}
jtfMainFrame.getContentPane().add(jplPanel, BorderLayout.CENTER);
jtfMainFrame.setVisible(true);
System.out.print("Yang");
}
}
import java.awt.event.*;
import javax.swing.*;
import java.util.Random;
class Test
{
public static int num[] = new int[42];
public static int numl = 16;
public static int numno = 0;
public static int chose = 0;
public static Boolean first = false;
public static void main(String[] args)
{
JFrame jtfMainFrame = new JFrame("Which Button Demo");
jtfMainFrame.setSize(450, 150);
JPanel jplPanel = new JPanel();
int i;
int j=1;
int num1 , num2;
//if(first == false){
for( i = 0 ;i<16;i++){
num[i] = i+1;
}
//first = true;
//}
JButton jbnButton[] = new JButton[16];
JButton changeButton[] = new JButton[2];
jplPanel.setLayout (new GridLayout(4, 4));
for(i = 0;i<=15;i++){
jbnButton[i]=new JButton("Button"+(i+1));
jplPanel.add(jbnButton[i]);
String s = Integer.toString(i+1);
jbnButton[i].addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Random ran = new Random();
chose = ran.nextInt(numl);
System.out.println(chose);
int i;
for( i=0; i<jbnButton.length; i++){
if(e.getSource() == jbnButton[i]){
jbnButton[i].setText(""+num[chose]);
}
}
for(i = chose ;i<numl;i++){
num[i] = num[i+1];
//System.out.println(num[chose]);
}
numl--;
System.out.println(numl);
for(i = 0 ;i<numl;i++){
//System.out.println(num[i]);
}
}
});
}
jtfMainFrame.getContentPane().add(jplPanel, BorderLayout.CENTER);
jtfMainFrame.setVisible(true);
System.out.print("Yang");
}
}
2015年4月24日 星期五
第六周
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class Test
{
public static void main(String[] args)
{
JFrame jtfMainFrame = new JFrame("Which Button Demo");
jtfMainFrame.setSize(450, 150);
JPanel jplPanel = new JPanel();
int i;
int j=1;
int num1 , num2;
JButton jbnButton[] = new JButton[16];
JButton changeButton[] = new JButton[2];
jplPanel.setLayout (new GridLayout(4, 4));
for(i = 0;i<=15;i++){
jbnButton[i]=new JButton("Button"+(i+1));
jplPanel.add(jbnButton[i]);
String s = Integer.toString(i+1);
jbnButton[i].addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("Button"+s);
}
});
}
jtfMainFrame.getContentPane().add(jplPanel, BorderLayout.CENTER);
jtfMainFrame.setVisible(true);
System.out.print("Yang");
}
}
import java.awt.event.*;
import javax.swing.*;
class Test
{
public static void main(String[] args)
{
JFrame jtfMainFrame = new JFrame("Which Button Demo");
jtfMainFrame.setSize(450, 150);
JPanel jplPanel = new JPanel();
int i;
int j=1;
int num1 , num2;
JButton jbnButton[] = new JButton[16];
JButton changeButton[] = new JButton[2];
jplPanel.setLayout (new GridLayout(4, 4));
for(i = 0;i<=15;i++){
jbnButton[i]=new JButton("Button"+(i+1));
jplPanel.add(jbnButton[i]);
String s = Integer.toString(i+1);
jbnButton[i].addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("Button"+s);
}
});
}
jtfMainFrame.getContentPane().add(jplPanel, BorderLayout.CENTER);
jtfMainFrame.setVisible(true);
System.out.print("Yang");
}
}
2015年4月17日 星期五
java 第五周 按鈕排列
按鈕排列
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class Test
{
public static void main(String[] args)
{
JFrame jtfMainFrame = new JFrame("Which Button Demo");
jtfMainFrame.setSize(450, 150);
JPanel jplPanel = new JPanel();
int i;
int j=1;
int num1 , num2;
JButton jbnButton[] = new JButton[9];
JButton changeButton[] = new JButton[2];
jplPanel.setLayout (new GridLayout(3, 3));
for(i = 0;i<=8;i++){
jbnButton[i]=new JButton("Button"+(i+1));
jplPanel.add(jbnButton[i]);
String s = Integer.toString(i+1);
jbnButton[i].addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
/*if(j<2){
changeButton[j] = jbnButton[i];
num1 = i;
j++;
}
else if(j==2){
changeButton[j]=jbnButton[i];
jbnButton[num1] = changeButton[j];
jbnButton[i] = changeButton[j-1];
j=1;
}*/
//j++;
//JButton btn = (JButton[i])e.getSourec();
//lab.setText(btn.getLabel+".");
System.out.println("Button"+s);
}
});
}
jtfMainFrame.getContentPane().add(jplPanel, BorderLayout.CENTER);
jtfMainFrame.setVisible(true);
System.out.print("chih-yu hsu");
}
}
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class Test
{
public static void main(String[] args)
{
JFrame jtfMainFrame = new JFrame("Which Button Demo");
jtfMainFrame.setSize(450, 150);
JPanel jplPanel = new JPanel();
int i;
int j=1;
int num1 , num2;
JButton jbnButton[] = new JButton[9];
JButton changeButton[] = new JButton[2];
jplPanel.setLayout (new GridLayout(3, 3));
for(i = 0;i<=8;i++){
jbnButton[i]=new JButton("Button"+(i+1));
jplPanel.add(jbnButton[i]);
String s = Integer.toString(i+1);
jbnButton[i].addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
/*if(j<2){
changeButton[j] = jbnButton[i];
num1 = i;
j++;
}
else if(j==2){
changeButton[j]=jbnButton[i];
jbnButton[num1] = changeButton[j];
jbnButton[i] = changeButton[j-1];
j=1;
}*/
//j++;
//JButton btn = (JButton[i])e.getSourec();
//lab.setText(btn.getLabel+".");
System.out.println("Button"+s);
}
});
}
jtfMainFrame.getContentPane().add(jplPanel, BorderLayout.CENTER);
jtfMainFrame.setVisible(true);
System.out.print("chih-yu hsu");
}
}
2015年4月10日 星期五
java 第四章 迴圈製作按鍵
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class Test
{
public static void main(String[] args)
{
JFrame jtfMainFrame = new JFrame("Which Button Demo");
jtfMainFrame.setSize(450, 150);
JPanel jplPanel = new JPanel();
int i;
int j=1;
JButton jbnButton[] = new JButton[9];
for(i = 0;i<=8;i++){
//JButton jbnButton1 = new JButton("Button 1")
//jbnButton[i] = new JButton();
jbnButton[i]=new JButton("Button"+(i+1));
jplPanel.add(jbnButton[i]);
String s = Integer.toString(i+1);
jbnButton[i].addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("Button"+s);
}
});
}
jtfMainFrame.getContentPane().add(jplPanel, BorderLayout.CENTER);
jtfMainFrame.setVisible(true);
System.out.print("chih-yu hsu");
}
}
2015年3月19日 星期四
java第三周上課內容
excel vba forloop 展示1~10
java 展示 1~10
程式碼
class ForDemo1 {
public static void main(String[] args) {
int i;
for (i = 1; i <= 10; i++) {
System.out.println(i);
}
}
}
java 展示 1~10
程式碼
class ForDemo1 {
public static void main(String[] args) {
int i;
for (i = 1; i <= 10; i++) {
System.out.println(i);
}
}
}
javascript 展示 1~10
程式碼
<HTML>
<HEAD>
</HEAD>
<BODY>
<script language="JavaScript">
for (i=1; i<=10; i=i+1)
{
document.write(i );
}
</SCRIPT>
</BODY>
</HTML>
2015年3月12日 星期四
java第二周上課內容
超連結:http://taiwantc.com/js/js_tut_a1.htm
打開wordpad 複製以下內容
<html>
<head>
<title> The First Example: Hello, World </title>
</head>
<body>
<h2> This line is HTML </h2>
<script language="JavaScript">
<!--
document.write("Hello, 楊大寬.This sentence is written using JavaScript.");
// Text on the right of 2 slashes is comment
/* This is comment
that occur more than 1 line
*/
//-->
</script>
<noscript>
Sorry, but your browser doesn't run JavaScript.
</noscript>
<h2> This line is HTML </h2>
</body>
</html>
儲存名稱 firstjava.html
使用google chrome開啟 IE不可
打開wordpad 複製以下內容
<html>
<head>
<title> The First Example: Hello, World </title>
</head>
<body>
<h2> This line is HTML </h2>
<script language="JavaScript">
<!--
document.write("Hello, 楊大寬.This sentence is written using JavaScript.");
// Text on the right of 2 slashes is comment
/* This is comment
that occur more than 1 line
*/
//-->
</script>
<noscript>
Sorry, but your browser doesn't run JavaScript.
</noscript>
<h2> This line is HTML </h2>
</body>
</html>
儲存名稱 firstjava.html
使用google chrome開啟 IE不可
java檢查ip
import java.net.*;
public class TestInet1 {
public static void main(String argv[])
{
try {
InetAddress myip = InetAddress.getLocalHost();
System.out.println(myip.getHostName());
System.out.println(myip.getHostAddress());
} catch (UnknownHostException e) {
System.out.println("Error: unable to resolve localhost");
}
}
}
javascript 查ip
<script language="JavaScript"> VIH_BackColor = "palegreen"; VIH_ForeColor = "navy"; VIH_FontPix = "16"; VIH_DisplayFormat = "You are visiting from:<br>IP Address: %%IP%%<br>Host: %%HOST%%"; VIH_DisplayOnPage = "yes"; </script> <script language="JavaScript" src="http://scripts.hashemian.com/js/visitorIPHOST.js.php"></script>
2015年3月5日 星期四
java 第一周上課內容
1.為何why要選修這門課?(動機)
A:學習Java
2.希忘從這門課獲得那些知識?(目標)
A:Java相關知識
3.我要如何修習這一門課?(態度與方法)
A:認真(應該)
環境變數
class Test
{
public static void main(String[] args)
{
System.out.println("_____*_____");
System.out.println("____***____");
System.out.println("___*****___");
System.out.println("__*******__");
System.out.println("_____*_____");
System.out.println("_____*_____");
}
}
A:學習Java
2.希忘從這門課獲得那些知識?(目標)
A:Java相關知識
3.我要如何修習這一門課?(態度與方法)
A:認真(應該)
環境變數
第一周實作
class Test
{
public static void main(String[] args)
{
System.out.println("_____*_____");
System.out.println("____***____");
System.out.println("___*****___");
System.out.println("__*******__");
System.out.println("_____*_____");
System.out.println("_____*_____");
}
}
2014年12月12日 星期五
16X16
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 WindowsFormsApplication9
{
public partial class Form1 : Form
{
Button[,] buttons = new Button[5, 5];
int i, j, sum, rn, rn1;
int[] a = new int[17], b = new int[17];
bool a1 = false, b1 = false;
string cho1, cho2;
int ch1i, ch1j, ch2i, ch2j,ch1,ch2;
bool onechoice = false;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
for (i = 1; i <= 16; i++)
{
a[i] = i;
}
for (i = 1; i <= 16; i++)
{
Random rn = new Random();
rn1 = rn.Next(1, 17 - i);
b[i] = a[rn1];
for (j = rn1; j <= 16 - i; j++)
{
a[j] = a[j + 1];
}
}
for (i = 1; i <= 4; i++)
{
for (j = 1; j <= 4; j++)
{
sum += 1;
buttons[i, j] = new Button();
buttons[i, j].TabIndex = sum;
buttons[i, j].Text = Convert.ToString(b[sum]);
if (b[sum] == 16)
{
buttons[i, j].Text = null;
}
buttons[i, j].Location = new Point(i * 50, j * 50);
buttons[i, j].Size = new Size(50, 50);
this.Controls.Add(buttons[i, j]);
buttons[i, j].Click += new EventHandler(buttons_Click);
}
}
}
private void buttons_Click(object sender, EventArgs e)
{
Button temp = (Button)sender;
label1.Text = temp.Text;
//MessageBox.Show(onechoice.ToString());
if (a1 == false)
{
cho1 = temp.Text;
a1 = true;
//MessageBox.Show(temp.Text);
}
else if (b1 == false && a1 == true)
{
//MessageBox.Show("2");
cho2 = temp.Text;
a1 = false;
}
for (int i = 1; i < 5; i++)
{
for (int j = 1; j <5 ; j++)
{
//MessageBox.Show(onechoice.ToString());
if (onechoice.ToString() == "False")
{
if (buttons[i,j].Text==cho1)
{
ch1i = i;
ch1j = j;
cho1 = temp.Text;
//MessageBox.Show(ch1i+","+ch1j);
onechoice = true;
}
}
else if(onechoice==true)
{
//onechoice = false;
if (temp.Text == buttons[i, j].Text)
{
//MessageBox.Show("1");
onechoice = false;
ch2i = i;
ch2j = j;
cho2 = temp.Text;
buttons[ch1i, ch1j].Text = cho2;
buttons[ch2i, ch2j].Text = cho1;
for (i = 1; i <= 4; i++)
{
for (j = 1; j <= 4; j++)
{
sum += 1;
buttons[i, j] = new Button();
buttons[i, j].TabIndex = sum;
//buttons[i, j].Text = Convert.ToString(b[sum]);
/*if (b[sum] == 16)
{
buttons[i, j].Text = null;
}*/
buttons[i, j].Location = new Point(i * 50, j * 50);
buttons[i, j].Size = new Size(50, 50);
this.Controls.Add(buttons[i, j]);
//buttons[i, j].Click += new EventHandler(buttons_Click);
}
}
}
}
}
}
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication9
{
public partial class Form1 : Form
{
Button[,] buttons = new Button[5, 5];
int i, j, sum, rn, rn1;
int[] a = new int[17], b = new int[17];
bool a1 = false, b1 = false;
string cho1, cho2;
int ch1i, ch1j, ch2i, ch2j,ch1,ch2;
bool onechoice = false;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
for (i = 1; i <= 16; i++)
{
a[i] = i;
}
for (i = 1; i <= 16; i++)
{
Random rn = new Random();
rn1 = rn.Next(1, 17 - i);
b[i] = a[rn1];
for (j = rn1; j <= 16 - i; j++)
{
a[j] = a[j + 1];
}
}
for (i = 1; i <= 4; i++)
{
for (j = 1; j <= 4; j++)
{
sum += 1;
buttons[i, j] = new Button();
buttons[i, j].TabIndex = sum;
buttons[i, j].Text = Convert.ToString(b[sum]);
if (b[sum] == 16)
{
buttons[i, j].Text = null;
}
buttons[i, j].Location = new Point(i * 50, j * 50);
buttons[i, j].Size = new Size(50, 50);
this.Controls.Add(buttons[i, j]);
buttons[i, j].Click += new EventHandler(buttons_Click);
}
}
}
private void buttons_Click(object sender, EventArgs e)
{
Button temp = (Button)sender;
label1.Text = temp.Text;
//MessageBox.Show(onechoice.ToString());
if (a1 == false)
{
cho1 = temp.Text;
a1 = true;
//MessageBox.Show(temp.Text);
}
else if (b1 == false && a1 == true)
{
//MessageBox.Show("2");
cho2 = temp.Text;
a1 = false;
}
for (int i = 1; i < 5; i++)
{
for (int j = 1; j <5 ; j++)
{
//MessageBox.Show(onechoice.ToString());
if (onechoice.ToString() == "False")
{
if (buttons[i,j].Text==cho1)
{
ch1i = i;
ch1j = j;
cho1 = temp.Text;
//MessageBox.Show(ch1i+","+ch1j);
onechoice = true;
}
}
else if(onechoice==true)
{
//onechoice = false;
if (temp.Text == buttons[i, j].Text)
{
//MessageBox.Show("1");
onechoice = false;
ch2i = i;
ch2j = j;
cho2 = temp.Text;
buttons[ch1i, ch1j].Text = cho2;
buttons[ch2i, ch2j].Text = cho1;
for (i = 1; i <= 4; i++)
{
for (j = 1; j <= 4; j++)
{
sum += 1;
buttons[i, j] = new Button();
buttons[i, j].TabIndex = sum;
//buttons[i, j].Text = Convert.ToString(b[sum]);
/*if (b[sum] == 16)
{
buttons[i, j].Text = null;
}*/
buttons[i, j].Location = new Point(i * 50, j * 50);
buttons[i, j].Size = new Size(50, 50);
this.Controls.Add(buttons[i, j]);
//buttons[i, j].Click += new EventHandler(buttons_Click);
}
}
}
}
}
}
}
}
}
2014年11月13日 星期四
9X9
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 WindowsFormsApplication5
{
public partial class Form1 : Form
{
Button[,] buttons = new Button[10, 10];
int i, j,sum;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
for (i = 1; i <= 9; i++)
{
for (j = 1; j <= 9; j++)
{
sum=i*j;
buttons[i, j] = new Button();
buttons[i, j].Text = Convert.ToString(sum);
buttons[i, j].Location = new Point( i*50, j*50);
buttons[i, j].Size = new Size(50, 50);
this.Controls.Add(buttons[i, j]);
}
}
label1.Text = Convert.ToString(buttons[1, 1].Name);
/*Button1 = new System.Windows.Forms.Button();
Button1.Location = new Point(100, 100);
Button1.Size = new Size(100, 100);
this.Controls.Add(Button1);
Button[] btuArray = new Button[3];
Button1.Click += new EventHandler(button1_Click);*/
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication5
{
public partial class Form1 : Form
{
Button[,] buttons = new Button[10, 10];
int i, j,sum;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
for (i = 1; i <= 9; i++)
{
for (j = 1; j <= 9; j++)
{
sum=i*j;
buttons[i, j] = new Button();
buttons[i, j].Text = Convert.ToString(sum);
buttons[i, j].Location = new Point( i*50, j*50);
buttons[i, j].Size = new Size(50, 50);
this.Controls.Add(buttons[i, j]);
}
}
label1.Text = Convert.ToString(buttons[1, 1].Name);
/*Button1 = new System.Windows.Forms.Button();
Button1.Location = new Point(100, 100);
Button1.Size = new Size(100, 100);
this.Controls.Add(Button1);
Button[] btuArray = new Button[3];
Button1.Click += new EventHandler(button1_Click);*/
}
}
}
2014年10月30日 星期四
C# 紅綠燈
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 WindowsFormsApplication7
{
public partial class Form1 : Form
{
int a=0,b;
public Form1()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
a = a + 1;
b = a % 3;
if (b == 1)
{
button1.BackColor = Color.Red;
button2.BackColor = Color.Black;
button3.BackColor = Color.Black;
}
else if (b == 2)
{
button1.BackColor = Color.Black;
button2.BackColor = Color.Yellow;
button3.BackColor = Color.Black;
}
else
{
button1.BackColor = Color.Black;
button2.BackColor = Color.Black;
button3.BackColor = Color.Green;
}
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication7
{
public partial class Form1 : Form
{
int a=0,b;
public Form1()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
a = a + 1;
b = a % 3;
if (b == 1)
{
button1.BackColor = Color.Red;
button2.BackColor = Color.Black;
button3.BackColor = Color.Black;
}
else if (b == 2)
{
button1.BackColor = Color.Black;
button2.BackColor = Color.Yellow;
button3.BackColor = Color.Black;
}
else
{
button1.BackColor = Color.Black;
button2.BackColor = Color.Black;
button3.BackColor = Color.Green;
}
}
}
}
2014年10月24日 星期五
C#04
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 WindowsFormsApplication4
{
public partial class Form1 : Form
{
int charch,chch,b1=1,b2=1,b3=1,b4=1,b5=1,b6=1,b7=1,b8=1,b9=1;
int bn1, bn2, bn3, bn4, bn5, bn6, bn7, bn8, bn9;
int win = 0;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
button1.Text = "";
button2.Text = "";
button3.Text = "";
button4.Text = "";
button5.Text = "";
button6.Text = "";
button7.Text = "";
button8.Text = "";
button9.Text = "";
}
private void button1_Click(object sender, EventArgs e)
{
if (b1 == 1)
{
charch = charch + 1;
chch = charch % 2;
if (chch == 1)
{
button1.Text = "o";
bn1 = 1;
}
else
{
button1.Text = "x";
bn1 = 2;
}
b1 = 2;
}
if (win == 0)
{
if (bn1 == bn2)
{
if (bn2 == bn3)
{
if (bn1 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn1 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn1 == bn4)
{
if (bn4 == bn7)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn2 == bn5)
{
if (bn5 == bn8)
{
if (bn2 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn2 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn6)
{
if (bn6 == bn9)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn4 == bn5)
{
if (bn5 == bn6)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn5)
{
if (bn5 == bn7)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn7 == bn8)
{
if (bn8 == bn9)
{
if (bn7 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn7 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
label2.Text = Convert.ToString(win);
}
private void button2_Click(object sender, EventArgs e)
{
if (b2 == 1)
{
charch = charch + 1;
chch = charch % 2;
if (chch == 1)
{
button2.Text = "o";
bn2 = 1;
}
else
{
button2.Text = "x";
bn2 = 2;
}
b2 = 2;
}
if (win == 0)
{
if (bn1 == bn2)
{
if (bn2 == bn3)
{
if (bn1 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn1 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn1 == bn4)
{
if (bn4 == bn7)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn2 == bn5)
{
if (bn5 == bn8)
{
if (bn2 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn2 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn6)
{
if (bn6 == bn9)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn4 == bn5)
{
if (bn5 == bn6)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn5)
{
if (bn5 == bn7)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn7 == bn8)
{
if (bn8 == bn9)
{
if (bn7 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn7 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
label2.Text = Convert.ToString(charch);
}
private void button3_Click(object sender, EventArgs e)
{
if (b3 == 1)
{
charch = charch + 1;
chch = charch % 2;
if (chch == 1)
{
button3.Text = "o";
bn3 = 1;
}
else
{
button3.Text = "x";
bn3 = 2;
}
b3 = 2;
}
if (win == 0)
{
if (bn1 == bn2)
{
if (bn2 == bn3)
{
if (bn1 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn1 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn1 == bn4)
{
if (bn4 == bn7)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn2 == bn5)
{
if (bn5 == bn8)
{
if (bn2 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn2 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn6)
{
if (bn6 == bn9)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn4 == bn5)
{
if (bn5 == bn6)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn5)
{
if (bn5 == bn7)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn7 == bn8)
{
if (bn8 == bn9)
{
if (bn7 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn7 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
label2.Text = Convert.ToString(win);
}
private void button4_Click(object sender, EventArgs e)
{
if (b4 == 1)
{
charch = charch + 1;
chch = charch % 2;
if (chch == 1)
{
button4.Text = "o";
bn4 = 1;
}
else
{
button4.Text = "x";
bn4 = 2;
}
b4 = 2;
}
if (win == 0)
{
if (bn1 == bn2)
{
if (bn2 == bn3)
{
if (bn1 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn1 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn1 == bn4)
{
if (bn4 == bn7)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn2 == bn5)
{
if (bn5 == bn8)
{
if (bn2 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn2 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn6)
{
if (bn6 == bn9)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn4 == bn5)
{
if (bn5 == bn6)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn5)
{
if (bn5 == bn7)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn7 == bn8)
{
if (bn8 == bn9)
{
if (bn7 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn7 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
label2.Text = Convert.ToString(win);
}
private void button6_Click(object sender, EventArgs e)
{
if (b6 == 1)
{
charch = charch + 1;
chch = charch % 2;
if (chch == 1)
{
button6.Text = "o";
bn6 = 1;
}
else
{
button6.Text = "x";
bn6 = 2;
}
b6 = 2;
}
if (win == 0)
{
if (bn1 == bn2)
{
if (bn2 == bn3)
{
if (bn1 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn1 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn1 == bn4)
{
if (bn4 == bn7)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn2 == bn5)
{
if (bn5 == bn8)
{
if (bn2 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn2 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn6)
{
if (bn6 == bn9)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn4 == bn5)
{
if (bn5 == bn6)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn5)
{
if (bn5 == bn7)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn7 == bn8)
{
if (bn8 == bn9)
{
if (bn7 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn7 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
label2.Text = Convert.ToString(win);
}
private void button5_Click(object sender, EventArgs e)
{
if (b5 == 1)
{
charch = charch + 1;
chch = charch % 2;
if (chch == 1)
{
button5.Text = "o";
bn5 = 1;
}
else
{
button5.Text = "x";
bn5 = 2;
}
b5 = 2;
}
if (win == 0)
{
if (bn1 == bn2)
{
if (bn2 == bn3)
{
if (bn1 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn1 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn1 == bn4)
{
if (bn4 == bn7)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn2 == bn5)
{
if (bn5 == bn8)
{
if (bn2 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn2 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn6)
{
if (bn6 == bn9)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn4 == bn5)
{
if (bn5 == bn6)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn5)
{
if (bn5 == bn7)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn7 == bn8)
{
if (bn8 == bn9)
{
if (bn7 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn7 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
label2.Text = Convert.ToString(win);
}
private void button7_Click(object sender, EventArgs e)
{
if (b7 == 1)
{
charch = charch + 1;
chch = charch % 2;
if (chch == 1)
{
button7.Text = "o";
bn7 = 1;
}
else
{
button7.Text = "x";
bn7 = 2;
}
b7 = 2;
}
if (win == 0)
{
if (bn1 == bn2)
{
if (bn2 == bn3)
{
if (bn1 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn1 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn1 == bn4)
{
if (bn4 == bn7)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn2 == bn5)
{
if (bn5 == bn8)
{
if (bn2 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn2 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn6)
{
if (bn6 == bn9)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn4 == bn5)
{
if (bn5 == bn6)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn5)
{
if (bn5 == bn7)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn7 == bn8)
{
if (bn8 == bn9)
{
if (bn7 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn7 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
label2.Text = Convert.ToString(win);
}
private void button8_Click(object sender, EventArgs e)
{
if (b8 == 1)
{
charch = charch + 1;
chch = charch % 2;
if (chch == 1)
{
button8.Text = "o";
bn8 = 1;
}
else
{
button8.Text = "x";
bn8 = 2;
}
b8 = 2;
}
if (win == 0)
{
if (bn1 == bn2)
{
if (bn2 == bn3)
{
if (bn1 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn1 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn1 == bn4)
{
if (bn4 == bn7)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn2 == bn5)
{
if (bn5 == bn8)
{
if (bn2 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn2 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn6)
{
if (bn6 == bn9)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn4 == bn5)
{
if (bn5 == bn6)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn5)
{
if (bn5 == bn7)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn7 == bn8)
{
if (bn8 == bn9)
{
if (bn7 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn7 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
label2.Text = Convert.ToString(win);
}
private void button9_Click(object sender, EventArgs e)
{
if (b9 == 1)
{
charch = charch + 1;
chch = charch % 2;
if (chch == 1)
{
button9.Text = "o";
bn9 = 1;
}
else
{
button9.Text = "x";
bn9 = 2;
}
b9 = 2;
}
if (win == 0)
{
if (bn1 == bn2)
{
if (bn2 == bn3)
{
if (bn1 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn1 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn1 == bn4)
{
if (bn4 == bn7)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn2 == bn5)
{
if (bn5 == bn8)
{
if (bn2 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn2 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn6)
{
if (bn6 == bn9)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn4 == bn5)
{
if (bn5 == bn6)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn5)
{
if (bn5 == bn7)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn7 == bn8)
{
if (bn8 == bn9)
{
if (bn7 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn7 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
label2.Text = Convert.ToString(win);
}
private void button10_Click(object sender, EventArgs e)
{
button1.Text = "";
button2.Text = "";
button3.Text = "";
button4.Text = "";
button5.Text = "";
button6.Text = "";
button7.Text = "";
button8.Text = "";
button9.Text = "";
b1 = 1;
b2 = 2;
b3 = 3;
b4 = 4;
b5 = 5;
b6 = 6;
b7 = 7;
b8 = 8;
b9 = 9;
bn1 = 0;
bn2 = 0;
bn3 = 0;
bn4 = 0;
bn5 = 0;
bn6 = 0;
bn7 = 0;
bn8 = 0;
bn9 = 0;
charch = 0;
win = 0;
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication4
{
public partial class Form1 : Form
{
int charch,chch,b1=1,b2=1,b3=1,b4=1,b5=1,b6=1,b7=1,b8=1,b9=1;
int bn1, bn2, bn3, bn4, bn5, bn6, bn7, bn8, bn9;
int win = 0;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
button1.Text = "";
button2.Text = "";
button3.Text = "";
button4.Text = "";
button5.Text = "";
button6.Text = "";
button7.Text = "";
button8.Text = "";
button9.Text = "";
}
private void button1_Click(object sender, EventArgs e)
{
if (b1 == 1)
{
charch = charch + 1;
chch = charch % 2;
if (chch == 1)
{
button1.Text = "o";
bn1 = 1;
}
else
{
button1.Text = "x";
bn1 = 2;
}
b1 = 2;
}
if (win == 0)
{
if (bn1 == bn2)
{
if (bn2 == bn3)
{
if (bn1 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn1 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn1 == bn4)
{
if (bn4 == bn7)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn2 == bn5)
{
if (bn5 == bn8)
{
if (bn2 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn2 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn6)
{
if (bn6 == bn9)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn4 == bn5)
{
if (bn5 == bn6)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn5)
{
if (bn5 == bn7)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn7 == bn8)
{
if (bn8 == bn9)
{
if (bn7 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn7 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
label2.Text = Convert.ToString(win);
}
private void button2_Click(object sender, EventArgs e)
{
if (b2 == 1)
{
charch = charch + 1;
chch = charch % 2;
if (chch == 1)
{
button2.Text = "o";
bn2 = 1;
}
else
{
button2.Text = "x";
bn2 = 2;
}
b2 = 2;
}
if (win == 0)
{
if (bn1 == bn2)
{
if (bn2 == bn3)
{
if (bn1 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn1 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn1 == bn4)
{
if (bn4 == bn7)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn2 == bn5)
{
if (bn5 == bn8)
{
if (bn2 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn2 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn6)
{
if (bn6 == bn9)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn4 == bn5)
{
if (bn5 == bn6)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn5)
{
if (bn5 == bn7)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn7 == bn8)
{
if (bn8 == bn9)
{
if (bn7 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn7 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
label2.Text = Convert.ToString(charch);
}
private void button3_Click(object sender, EventArgs e)
{
if (b3 == 1)
{
charch = charch + 1;
chch = charch % 2;
if (chch == 1)
{
button3.Text = "o";
bn3 = 1;
}
else
{
button3.Text = "x";
bn3 = 2;
}
b3 = 2;
}
if (win == 0)
{
if (bn1 == bn2)
{
if (bn2 == bn3)
{
if (bn1 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn1 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn1 == bn4)
{
if (bn4 == bn7)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn2 == bn5)
{
if (bn5 == bn8)
{
if (bn2 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn2 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn6)
{
if (bn6 == bn9)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn4 == bn5)
{
if (bn5 == bn6)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn5)
{
if (bn5 == bn7)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn7 == bn8)
{
if (bn8 == bn9)
{
if (bn7 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn7 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
label2.Text = Convert.ToString(win);
}
private void button4_Click(object sender, EventArgs e)
{
if (b4 == 1)
{
charch = charch + 1;
chch = charch % 2;
if (chch == 1)
{
button4.Text = "o";
bn4 = 1;
}
else
{
button4.Text = "x";
bn4 = 2;
}
b4 = 2;
}
if (win == 0)
{
if (bn1 == bn2)
{
if (bn2 == bn3)
{
if (bn1 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn1 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn1 == bn4)
{
if (bn4 == bn7)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn2 == bn5)
{
if (bn5 == bn8)
{
if (bn2 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn2 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn6)
{
if (bn6 == bn9)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn4 == bn5)
{
if (bn5 == bn6)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn5)
{
if (bn5 == bn7)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn7 == bn8)
{
if (bn8 == bn9)
{
if (bn7 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn7 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
label2.Text = Convert.ToString(win);
}
private void button6_Click(object sender, EventArgs e)
{
if (b6 == 1)
{
charch = charch + 1;
chch = charch % 2;
if (chch == 1)
{
button6.Text = "o";
bn6 = 1;
}
else
{
button6.Text = "x";
bn6 = 2;
}
b6 = 2;
}
if (win == 0)
{
if (bn1 == bn2)
{
if (bn2 == bn3)
{
if (bn1 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn1 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn1 == bn4)
{
if (bn4 == bn7)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn2 == bn5)
{
if (bn5 == bn8)
{
if (bn2 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn2 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn6)
{
if (bn6 == bn9)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn4 == bn5)
{
if (bn5 == bn6)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn5)
{
if (bn5 == bn7)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn7 == bn8)
{
if (bn8 == bn9)
{
if (bn7 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn7 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
label2.Text = Convert.ToString(win);
}
private void button5_Click(object sender, EventArgs e)
{
if (b5 == 1)
{
charch = charch + 1;
chch = charch % 2;
if (chch == 1)
{
button5.Text = "o";
bn5 = 1;
}
else
{
button5.Text = "x";
bn5 = 2;
}
b5 = 2;
}
if (win == 0)
{
if (bn1 == bn2)
{
if (bn2 == bn3)
{
if (bn1 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn1 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn1 == bn4)
{
if (bn4 == bn7)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn2 == bn5)
{
if (bn5 == bn8)
{
if (bn2 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn2 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn6)
{
if (bn6 == bn9)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn4 == bn5)
{
if (bn5 == bn6)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn5)
{
if (bn5 == bn7)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn7 == bn8)
{
if (bn8 == bn9)
{
if (bn7 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn7 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
label2.Text = Convert.ToString(win);
}
private void button7_Click(object sender, EventArgs e)
{
if (b7 == 1)
{
charch = charch + 1;
chch = charch % 2;
if (chch == 1)
{
button7.Text = "o";
bn7 = 1;
}
else
{
button7.Text = "x";
bn7 = 2;
}
b7 = 2;
}
if (win == 0)
{
if (bn1 == bn2)
{
if (bn2 == bn3)
{
if (bn1 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn1 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn1 == bn4)
{
if (bn4 == bn7)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn2 == bn5)
{
if (bn5 == bn8)
{
if (bn2 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn2 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn6)
{
if (bn6 == bn9)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn4 == bn5)
{
if (bn5 == bn6)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn5)
{
if (bn5 == bn7)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn7 == bn8)
{
if (bn8 == bn9)
{
if (bn7 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn7 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
label2.Text = Convert.ToString(win);
}
private void button8_Click(object sender, EventArgs e)
{
if (b8 == 1)
{
charch = charch + 1;
chch = charch % 2;
if (chch == 1)
{
button8.Text = "o";
bn8 = 1;
}
else
{
button8.Text = "x";
bn8 = 2;
}
b8 = 2;
}
if (win == 0)
{
if (bn1 == bn2)
{
if (bn2 == bn3)
{
if (bn1 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn1 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn1 == bn4)
{
if (bn4 == bn7)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn2 == bn5)
{
if (bn5 == bn8)
{
if (bn2 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn2 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn6)
{
if (bn6 == bn9)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn4 == bn5)
{
if (bn5 == bn6)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn5)
{
if (bn5 == bn7)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn7 == bn8)
{
if (bn8 == bn9)
{
if (bn7 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn7 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
label2.Text = Convert.ToString(win);
}
private void button9_Click(object sender, EventArgs e)
{
if (b9 == 1)
{
charch = charch + 1;
chch = charch % 2;
if (chch == 1)
{
button9.Text = "o";
bn9 = 1;
}
else
{
button9.Text = "x";
bn9 = 2;
}
b9 = 2;
}
if (win == 0)
{
if (bn1 == bn2)
{
if (bn2 == bn3)
{
if (bn1 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn1 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn1 == bn4)
{
if (bn4 == bn7)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn2 == bn5)
{
if (bn5 == bn8)
{
if (bn2 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn2 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn6)
{
if (bn6 == bn9)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn4 == bn5)
{
if (bn5 == bn6)
{
if (bn4 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn4 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn3 == bn5)
{
if (bn5 == bn7)
{
if (bn3 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn3 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
if (win == 0)
{
if (bn7 == bn8)
{
if (bn8 == bn9)
{
if (bn7 == 1)
{
MessageBox.Show("O win");
win = 1;
}
else if (bn7 == 2)
{
MessageBox.Show("X win");
win = 1;
}
}
}
}
label2.Text = Convert.ToString(win);
}
private void button10_Click(object sender, EventArgs e)
{
button1.Text = "";
button2.Text = "";
button3.Text = "";
button4.Text = "";
button5.Text = "";
button6.Text = "";
button7.Text = "";
button8.Text = "";
button9.Text = "";
b1 = 1;
b2 = 2;
b3 = 3;
b4 = 4;
b5 = 5;
b6 = 6;
b7 = 7;
b8 = 8;
b9 = 9;
bn1 = 0;
bn2 = 0;
bn3 = 0;
bn4 = 0;
bn5 = 0;
bn6 = 0;
bn7 = 0;
bn8 = 0;
bn9 = 0;
charch = 0;
win = 0;
}
}
}
訂閱:
文章 (Atom)














