树上的游戏,砍树枝
我们有一片扎根的树木森林。两名玩家根据以下规则交替移动:一次移动是切割顶点及其所有子节点。做出最后一步(没有顶点剩余)的玩家获胜。
我们如何计算游戏中位置的 Grundy 函数?
假设我们有一棵树,我们需要判断当前位置是赢还是输?
We have a forest of rooted trees. Two players makes alternating moves according to the following rule: one move is to cut vertex and all its children. Player which makes last move (no vertices remain) wins.
How can we compute Grundy function for the positions in the game?
Suppose we have a trees and we need to say whether current position is winning or losing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是Hackenbush游戏。我强烈推荐这篇文章,它非常清晰地介绍了 Grundy 数字,最后彻底讨论了 hackenbush。
This is the Hackenbush game. I highly recommend this article, which covers Grundy numbers with great clarity and thoroughly discusses hackenbush toward the end.