当前位置:首页 » 操作系统 » 曙光象棋源码

曙光象棋源码

发布时间: 2022-12-16 09:58:26

1. 有什么厉害的手机版象棋软件

http://www.xqbase.com/xqwizard/xqwlight.htm象棋小巫师,目前最厉害的手机象棋对弈软件,这个地址可以下,也可以直接用手机上网下载

2. VB 中国象棋源代码

你是要交作业吗?是要原创的吗?网上的可能很多人都有,但我自己写的还没有发表,哈哈。这里贴不了全的,我可以写一段给你看看,你觉得可以,就找我要吧,完全free的,能帮到你最好。

贴保存棋局和读取棋局部分的,你先看看:
Rem 读取棋局
Private Sub mnuRead_Click()
Dim s As String, i As Integer, t
If Dir(App.Path & "\cchess.che") = "" Then MsgBox "没有棋局文件可以读入!请先保存棋局!", , "中国象棋": Exit Sub

Open App.Path & "\cchess.che" For Input As #1
Input #1, s
Close #1

s = Replace(s, vbCrLf, "")
s = Trim(s)

t = Split(s, " ")
If UBound(t) <> 89 Then MsgBox "棋局文件已遭到破坏!请重新保存棋局!", , "中国象棋": Exit Sub

For i = 0 To 89
a(i) = Val(t(i))
Next

MsgBox "棋局文件已成功读入!", , "中国象棋"
End Sub

Rem 保存棋局
Private Sub mnuSave_Click()
Dim s As String, i As Integer
s = ""
For i = 0 To 89
s = s & " " & a(i)
Next
s = Trim(s)
Open App.Path & "\cchess.che" For Output As #1
Print #1, s;
Close #1
MsgBox "当前棋局已成功保存!", , "中国象棋"
End Sub

3. 急求c++课程设计中国象棋源代码

太有难度了

4. 急求C++设计象棋打谱程序的源代码

这是一个简单的程序,会自动计算提子,但不会数目。其它的运行一次估计就差不多会用了。稍微写了点注释。

#include<stdio.h>
#include<stdlib.h>

char board[21][21];
char move[5][2]=,,,,};

void initBoard();//初始化棋盘
void showBoard();//输出棋盘
char set(int x,int y,char color);//下子
void process(int xx,int yy);//计算提子

int main()
{
FILE * fptr=NULL;
char pufile[256]=;
char op;
int s;
int x,y,r;
char color;
char win;
int cnt;

start:
s=8;
while(s!=1 && s!=2)
{
printf("选择模式:\n1---下棋\n2---看棋谱\n0---退出\n");
printf("下棋模式下,下子请输入s x y(x,y为位置),认输输入g,和棋输入h\n选择:");
scanf("%d",&s);
if(s==0) return 0;
//Egg1
if(s==10) printf("Programmer: swordlance :)\n");
//Egg1 end
}
getchar();
printf("输入棋谱路径:");
gets(pufile);

if(s==1) fptr=fopen(pufile,"w");
else fptr=fopen(pufile,"r");

if(!fptr)
{
printf("文件无法打开(创建)!\n");
system("PAUSE");
return -1;
}

initBoard();
cnt=0;
color='B';
while(op!='g')
{
system("CLS");
showBoard();
printf("(第%d手)",++cnt);
if(s==1)
{
printf("%c 方:",color);
scanf("%c",&op);
//printf("[%c]",op);
if(op=='s')
{
scanf("%d %d",&x,&y);
getchar();
if(set(x,y,color)!=0)
{
printf("该处不能落子!\n");
cnt--;
system("PAUSE");
}
else
{
process(x,y);
fprintf(fptr,"%d %d\n",x,y);
if(color=='B') color='W';
else color='B';
}
}
else if(op=='g')
{
printf("%c 方认输。\n",color);
if(color=='B') fprintf(fptr,"0 1\n");
else fprintf(fptr,"0 -1\n");
fflush(fptr);
fclose(fptr);
system("PAUSE");
goto start;
}
else if(op=='h')
{
printf("和棋。\n");
fprintf(fptr,"0 0\n");
fflush(fptr);
fclose(fptr);
system("PAUSE");
goto start;
}
else
{
printf("参数错误,下子请输入s x y(x,y为位置),认输输入 g,和棋输入h");
cnt--;
system("PAUSE");
}
}
else
{
fscanf(fptr,"%d %d",&x,&y);
if(x==0)
{
if(y>0) printf("W 方胜!\n");
else if(y<0) printf("B 方胜!\n");
else printf("和棋!\n");
system("PAUSE");
goto start;
}
else
{
printf("%c 方落子(%d,%d)\n",color,x,y);
set(x,y,color);
process(x,y);
if(color=='B') color='W';
else color='B';
}
system("PAUSE");
}
}

system("PAUSE");
return 0;
}

void initBoard()
{
int i,j;
board[0][0]='O';
for(i=1;i<=19;i++) board[0][i]='-';
board[0][20]='O';
for(i=1;i<=19;i++)
{
board[i][0]='|';
for(j=1;j<=19;j++) board[i][j]='+';
board[i][20]='|';
}
board[20][0]='O';
for(i=1;i<=19;i++) board[20][i]='-';
board[20][20]='O';
board[4][4]=board[4][10]=board[4][16]=
board[10][4]=board[10][10]=board[10][16]=
board[16][4]=board[16][10]=board[16][16]='*';
}

void showBoard()
{
int i,j;
for(i=0;i<=20;i++)
{
for(j=0;j<=20;j++)
{
printf("%c",board[i][j]);
}
printf("\n");
}
}

char set(int x,int y,char color)
{
if(board[x][y]=='W' || board[x][y]=='B') return -1;//不能落子
else board[x][y]=color;
return 0;
}

//计算提子
void process(int xx,int yy)
{
char his[21][21]=;//记录算过的棋子以节约效率
char Q[400][2]=;//某一片棋
int e;//Q的长度。
char mcolor;//这片棋的颜色
char ecolor;//另一种颜色
int QI=0;//气数
int i,j,k,l,m;
int x,y;

for(m=0;m<5;m++)
{
i=xx+move[m][0];//为了能够完成打劫,先算别人再算自己
j=yy+move[m][1];
if(his[i][j]==0 && (board[i][j]=='W' || board[i][j]=='B')) //该位置有子开始算气
{
QI=0;
his[i][j]=1;
mcolor=board[i][j];
ecolor=(board[i][j]=='W'?'B':'W');
//printf("m=%c e=%c\n",mcolor,ecolor);
Q[0][0]=i;
Q[0][1]=j;
e=1;
for(k=0;k<e;k++)
{
for(l=0;l<4;l++)
{
x=Q[k][0]+move[l][0];
y=Q[k][1]+move[l][1];
//printf("x=%d y=%d\n",x,y);
//system("PAUSE");
if(x>0 && y>0 && x<20 && y<20 && his[x][y]==0)
{
if(board[x][y]==mcolor)//己方,长气
{
Q[e][0]=x;
Q[e][1]=y;
e++;
his[x][y]=1;
}
else
{
if(board[x][y]=='+') QI++; //空地,加气,忽略重复计算
}
}
}
}
//printf("QI=%d\n",QI);
//system("PAUSE");
if(!QI)//死棋,提子
{
for(k=0;k<e;k++)
{
board[Q[k][0]][Q[k][1]]='+';
his[Q[k][0]][Q[k][1]]=0;
}
}
}
}
}

5. 曙光象棋app怎么搜不到,是不是骗人的

曙光相机app怎么搜不到是不是骗人的这个游戏不是吧?

6. 用c语言输出中国象棋棋盘的源代码!!急!急!急!

密码:yq12

7. 曙光象棋咋配合天天象棋在手机上玩呢

曙光象棋手机最强版是一款手机下象棋软件,在软件中用户可以和智能AI进行对弈,提高自己的象棋技术,软件中设置了多个智能AI级别,还有深度和节点的设置,玩家根据自己的水平来进行智能AI的选择,除了开局重新开始之外,还有很多的残局供玩家思考游玩。

8. 易语言做中国象棋用到哪些组件

动画框+动画组件,不排除你可以用组件堆

9. 谁有象棋的源程序啊,c语言、C#、Java都行

我提供两个功能完善,而且最重要的,我认为算法设计比较好的中国象棋源代码,因为是源码网的,所以可以学习参考下:
http://www.codefans.net/soft/1466.shtml
http://www.codefans.net/soft/1289.shtml

热点内容
19投篮脚本 发布:2025-05-14 23:36:57 浏览:511
编译器怎么处理c变长数组 发布:2025-05-14 23:31:46 浏览:662
存折每天可以输错多少次密码 发布:2025-05-14 23:22:06 浏览:908
安卓手机怎么找微信隐藏对话 发布:2025-05-14 23:07:47 浏览:337
怎么查看泰拉服务器ip 发布:2025-05-14 23:03:29 浏览:73
c语言学生成绩查询系统 发布:2025-05-14 22:58:30 浏览:5
怎么进别人的服务器 发布:2025-05-14 22:45:55 浏览:773
用编程写音乐 发布:2025-05-14 22:45:08 浏览:782
如何识别电脑的网络配置 发布:2025-05-14 22:38:46 浏览:848
pipforpython3 发布:2025-05-14 22:38:34 浏览:350