定制迷你(更少的方块,更少的棋子)棋盘 5x5 的实现代码
在 java 或 c++ 甚至 c# 中实现定制迷你(更少的方块,更少的棋子)棋盘的代码
我只是需要帮助来做出最佳的动作。而且我不需要任何图形界面。
输入将给出为
“rnkrrppp*****PPPRNKNR”
其中
棋子:P
车:R
骑士:N
国王:K
这里小字母代表黑子,大写字母代表白子,“*”代表空方块
,输出如下
a2a3
如果最佳移动发生于
a2 到 a3
仅限申请。对于每一个动作。
在此不需要接口,因为我们直接将输入作为字符串给出。
首先我开始理解java、c++、c#中的8*8棋盘编程,但在某些情况下我面临着理解问题。
看到的许多源代码正在尝试使用预定义的最佳移动列表进行移动。
并且没有特定的想法来解决这个问题。我想要建议开始这个并解决这个问题。
谢谢。抱歉英语不好
implementing code for customized mini(less squares, less pieces ) chess board in java or c++ or even in c#
I just want help for making best moves. and I don't need any graphical interface.
input will be given as
"rnkrrppp*****PPPRNKNR"
where
Pawns: P
Rooks: R
Knights: N
King: K
here small letters represents black pieces and capital letters represents white pieces and "*" represents empty square
and output like
a2a3
if best move happened from
a2 to a3
by application only. for every move.
in this no inter face is required because we give input direct as string.
first I started to understand 8*8 chess board programming in java, c++ ,c# but I facing problem to understanding in some cases.
many source codes which seen is attempting moves with predefined best moves list.
and don't have a particular idea to solve this. I want suggestion start this and make this solved.
thanks. and sorry for poor english
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要研究 alpha beta 剪枝的工作原理。关于国际象棋编程的文献有很多,我建议您从这里开始。作为一个非常小的例子,在这里查看我的项目 。我指着一个文件,它是寻找最佳动作的测试。我的引擎尚未优化,但足够简单以了解其工作原理。如果您使用简化的键盘,它并不介意,只要您创建了适当的移动生成器和键盘评估器,算法就相同(通常材料值就足够了)。
You need to study how alpha beta pruning works. There is a lot of literature about chess programming, I suggest you to start from here. As a very little example, look at my project here. I pointed to a file that is a test in finding a best move. My engine is not optimized, but simple enought to get how it works. It does not mind if you are using a reduced keyboard, the algorithm is the same as soon you created a proper move generator and a keyboard evaluator ( usually material value is enought ).