下载此文档

中国象棋游戏源代码资料.doc


文档分类:IT计算机 | 页数:约21页 举报非法文档有奖
1/21
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/21 下载此文档
文档列表 文档介绍
using System; using ; using ponentModel; using ; using ; using ; using ; using ; namespace 象棋{ enum player { blank, red, blue, }; enum chesstype { blank, jiang, che, ma, pao, xiang, zu, shi }; struct chess { public player side; public chesstype type; }; // 下载于 uct block { public PictureBox container; public chess item; }; public partial class Form1 : Form { public Form1() { ponent(); pictureboxlist = new List <PictureBox>(81); Matrix= new block[10][]; int i,j; for (i= 0;i< 10;i++ ) { Matrix[i] = new block[9]; } for (i=0;i<10;i++) { for (j=0;j<9;j++) { Control[] col = this .( "pictureBox" + (i*9+j+1), false ); Matrix[i][j].container=col[0] as PictureBox; Matrix[i][j]. = new Point(60 * j, 60* i); } } redcoll = new collecter(); bluecool = new collecter(); for (i= 91; i< 107;i++ ) { Control[] col = this .( "pictureBox" + i, false ); (col[0] as PictureBox); } for (i= 107; i< 123;i++ ) { Control[] col = this .( "pictureBox" + i, false ); (col[0] as PictureBox); } resetground(); } List <PictureBox> pictureboxlist; block[][] Matrix; collecter redcoll; collecter bluecool; int chozenX; int chozenY; player currentside; bool beenchozen; bool clickswitch; private void click1( object sender, EventArgs e) { if (!clickswitch) { resetground(); return ;} string name = (sender as PictureBox).Name; string number = (10); int index = Convert .ToInt32(number); int i,j; bool flag = false ; i=(index-1)/9; j=(index-1)%9; // 下载于 (beenchozen) { Matrix[chozenX][chozenY]. = ; Matrix[chozenX][chozenY]. = ; beenchozen = false ; if (Matrix[chozenX][chozenY].==Matrix[i][j].it ) { return ;} if (Matrix[chozenX][chozenY]. != ) { if (Matrix[i][j].== ) { flag= true ;} if (!movechess(i, j))

中国象棋游戏源代码资料 来自淘豆网www.taodocs.com转载请标明出处.

非法内容举报中心
文档信息
最近更新