我该如何开始使用Gomoku? [英] How do i start with Gomoku?

查看:110
本文介绍了我该如何开始使用Gomoku?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解到 Gomoku ,它可以使用Minimax和Alpha-Beta修剪算法来实现。因此,我阅读了这些算法,现在了解了如何解决游戏。但是当我坐下来编写代码时,我面临着如何实现它的问题。

I read about Gomoku that it can be implemented using Minimax and Alpha-Beta Pruning algorithms. So, i read these algorithms and now understand how the game will be solved. But when i sat to down to code, I am facing problem how to approach it.

与在中一样,


  • 如何设计原型函数,例如getNextMove或Max(Move)?

  • 下一步将如何搜索?

  • 直到我应该何时应用minimax算法。

  • 我知道我可以在网上找到代码,但我想自己做。

  • How to design the prototype functions like getNextMove or Max(Move) ?
  • How will the next move searched?
  • Till when should i apply the minimax algorithm.
  • I know i can find the code online, but i want to do it myself.

有人可以指出正确的方向吗? / p>

Can anyone please point me in the right direction?

推荐答案

教科书中介绍的minimax算法通常应用于简单的游戏,例如tic-tac-tou,在最小玩家和最大玩家之间只有几回合才能达到最终状态。但是,对于Gomoku,不可能达到所有最终状态。为什么我们需要达到最终状态?我们需要对举动进行评估,即举动是否良好。

the minimax algorithm presented in the textbook is usually applied on simple games, e.g. tic-tac-tou, where the final states are reachable within only several turns between min player and max player. However, for Gomoku, it is impossible to reach all final states. Why do we need to reach final states? We need an evaluation for a move, i.e. whether a move is good or not.

因此,第一步是设计移动的评估函数,该函数将告诉您进行一次移动将适当获得多少价值。例如如果您连续有3个,则沿该行移动为4个将非常有价值。

So your first step is to design an evaluation function of a move, which tells you how much value you will properly gain if you do one move. e.g. you have a 3 in a row, the move along that row to make a 4 will be very valuable.

假设您具有非常聪明的评估功能,那么每次都无需搜索即可找到最佳移动。因此,在进行最小-最大,alpha-beta测试之前,您可能需要设计出良好的评估功能。 Emacs的gomoku源代码就是一个很好的例子,该源代码具有出色的AI播放器,无需进行任何搜索。

Suppose that you have a very clever evaluation function, then you can find an optimal move each time without any search. So before you do any min-max, alpha-beta, you'd probably design a good evaluation function. A good example is Emacs' gomoku source code, which has a good AI player without using any search.

接下来,您转到最小-最大和alpha-beta。

Next you move to min-max and alpha-beta.

似乎我没有回答您的问题。其实我不需要我假设您知道tic-tac-tao的min-max或alpha-beta搜索的详细信息。通过设计评估功能,您将更好地了解gomoku,并为其设计搜索算法,就像现在对tic-tac-tou一样。

It seems that I didn't answer your questions. Actually I don't need. I assume that you know the details of min-max or even alpha-beta search for tic-tac-tao. By designing the evaluation function, you will have a better understanding of gomoku and you design search algorithm for it just as you can do for tic-tac-tou now.

这篇关于我该如何开始使用Gomoku?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆