最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
去年用c#写的五子棋程序
时间:2022-07-02 11:35:00 编辑:袖梨 来源:一聚教程网
c#写的五子棋程序,供学习WinForms的鼠标事件和使用GDI+
前几天没事(是去年的事了),写了一个小程序,可以用于学习C#。
程序使用了VS.NET环境编译,你的机器只要安装了.NET Framework SDK就可以运行。
源码和执行文件可以下载
http://www.wh-adv.com/download/five.zip
你不想下载也可读一下源码(图片资源等需要下载)。
namespace Leimom.FiveChess
{
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.WinForms;
using System.Data;
///
/// Summary description for Form1.
///
public class FiveForm : System.WinForms.Form
{
///
/// Required designer variable.
///
private System.ComponentModel.Container components;
private System.WinForms.ImageList imageListbw;
//define the hot Rectangle
private Rectangle[] pointSquares;
//chess information
private int[] chessTable;
private int nextTurn;
private const int bTurn = 1;
private const int wTurn = 2;
private Stack chessIndex;
public FiveForm()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
chessIndex = new Stack();
nextTurn = bTurn;
chessTable = new int[225];
pointSquares = new Rectangle[225];
Size size = new Size(18,18);
int x = 0;
int y = 0;
for(int i = 0;i < 225;i++)
{
x = i%15;
y = i/15;
前几天没事(是去年的事了),写了一个小程序,可以用于学习C#。
程序使用了VS.NET环境编译,你的机器只要安装了.NET Framework SDK就可以运行。
源码和执行文件可以下载
http://www.wh-adv.com/download/five.zip
你不想下载也可读一下源码(图片资源等需要下载)。
namespace Leimom.FiveChess
{
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.WinForms;
using System.Data;
///
/// Summary description for Form1.
///
public class FiveForm : System.WinForms.Form
{
///
/// Required designer variable.
///
private System.ComponentModel.Container components;
private System.WinForms.ImageList imageListbw;
//define the hot Rectangle
private Rectangle[] pointSquares;
//chess information
private int[] chessTable;
private int nextTurn;
private const int bTurn = 1;
private const int wTurn = 2;
private Stack chessIndex;
public FiveForm()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
chessIndex = new Stack();
nextTurn = bTurn;
chessTable = new int[225];
pointSquares = new Rectangle[225];
Size size = new Size(18,18);
int x = 0;
int y = 0;
for(int i = 0;i < 225;i++)
{
x = i%15;
y = i/15;
相关文章
- 王者荣耀侦探能力大测试攻略 王者荣耀侦探能力大测试怎么过 11-22
- 无期迷途主线前瞻兑换码是什么 11-22
- 原神欧洛伦怎么培养 11-22
- 炉石传说网易云音乐联动怎么玩 11-22
- 永劫无间手游确幸转盘怎么样 11-22
- 无期迷途主线前瞻兑换码是什么 无期迷途主线前瞻直播兑换码介绍 11-22