注册 登录
编程论坛 VB.NET论坛

用Vb.net写的中国象棋。

q24469 发布于 2013-09-11 12:42, 1457 次点击
写的中国象棋。从中您可以学到一些基础知识,甚至可以玩这款自己亲手制作的象棋游戏


源码下载:
[local]1[/local]

之前上传的棋力太差了,第一次上传没注意不好意思,现在重新上传下

或下载地址:
http://pan.baidu.com/s/1kT9cSOB

[ 本帖最后由 q24469 于 2014-1-7 11:13 编辑 ]
9 回复
#2
3037709572013-09-11 12:57
还凑合,有许多地方需要改进。
#3
3037709572013-09-11 13:39
大概的看了,总结一下。

用C#来表述,这三个函数是关键:
[DllImport("GenerateMoves.dll", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]
public static extern bool Checked(int[] ucpcSquares, int SdPlayer);

[DllImport("GenerateMoves.dll", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]
public static extern int GenerateCapture(int[] ucChessBoard, int[] Mvs, int SdPlayer);

[DllImport("GenerateMoves.dll", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]
public static extern int GenerateMoves2(int[] ucChessBoard, int[] Mvs, int SdPlayer);

亦或,用来表述,这三个函数是关键:
 <DllImport("GenerateMoves.dll", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
        Public Shared Function Checked(ByVal ucpcSquares As Integer(), ByVal SdPlayer As Integer) As Boolean

 <DllImport("GenerateMoves.dll", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
        Public Shared Function GenerateCapture(ByVal ucChessBoard As Integer(), ByVal Mvs As Integer(), ByVal SdPlayer As Integer) As Integer
      
 <DllImport("GenerateMoves.dll", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
        Public Shared Function GenerateMoves2(ByVal ucChessBoard As Integer(), ByVal Mvs As Integer(), ByVal SdPlayer As Integer) As Integer

换句话来说:GenerateMoves.dll这个C++的动态链接库文件才是重点也是关键。

#4
3037709572013-09-11 13:41
楼主要是能把GenerateMoves.dll这个文件的源码拿出来晒一晒那就更好了,期待!
#5
q244692013-09-11 17:27
回复 4楼 303770957
只有本站会员才能查看附件,请 登录


#6
3037709572013-09-11 17:30
多谢楼主分享!

[ 本帖最后由 303770957 于 2013-9-11 17:32 编辑 ]
#7
lianwen2013-10-28 22:16
看了,感觉有些地方能用到,呵呵,刚学不久
#8
q244692014-01-07 11:10
之前上传的棋力太差了,第一次上传没注意不好意思,现在重新上传下

下载地址:
http://pan.baidu.com/s/1kT9cSOB
#9
tongpudian2020-02-16 19:35
回复 7楼 lianwen
能发给我吗?
#10
tongpudian2020-02-16 19:37
回复 9楼 tongpudian
可以发给我吗?tongpudian@ 谢谢。
1