求一个简单的C#五子棋程序,要的是控制台输出的!

[复制链接]
查看11 | 回复0 | 2008-1-1 22:11:57 | 显示全部楼层 |阅读模式
程序使用了vs.net环境编译,你的机器只要安装了.net framework sdk就可以运行。源码和执行文件可以下载你不想下载也可读一下源码(图片资源等需要下载)。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; pointsquares.size = size; pointsquares.offset(9+x*20,6+y*20); chesstable = 0; } } protected override void onpaint(painteventargs e) { //you may paint graphics g = e.graphics; } protected override void onmousedown(system.winforms.mouseeventargs e){ switch( e.button ) { //take left button down case mousebuttons.left: onlbuttondown(new point(e.x,e.y)); break; //take right button down case mousebuttons.right:
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行