gpt4 book ai didi

algorithm - 生成一个不需要猜测的扫雷板

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:19:51 25 4
gpt4 key购买 nike

<分区>

我正在设计一个类似扫雷的游戏(修改了规则),我想防止玩家猜测。我的目标是:生成的棋盘显示的方 block 很少,玩家无需猜测即可解决整个谜题。

Wikipedia提到:

Some implementations of Minesweeper will set up the board by never placing a mine on the first square revealed, or by arranging the board so that the solution does not require guessing.

但是,我无法弄清楚算法。

此外,在另一个 StackOverflow 问题中:Minesweeper solving algorithm

Improvement: Run the solver alongside the generator, making sure that the puzzle has a unique solution. This takes some cleverness, and isn't done in most variants.

我怀疑这是否真的有效。众所周知solving minesweeper是NP完全的。

总而言之,我的问题是:

  • 如何生成不需要任何猜测的扫雷板?
  • 如果可以,具体算法是什么?
  • 我们能否在多项式时间内确定性地解决这个问题?这个问题是NP完全的吗?如何证明?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com