极小极大算法需要对每个节点中的游戏状态进行某种评估。在战列舰中,你没有作为玩家或 AI 的所有信息(对手的舰船是未知的),这使得你不可能做到这一点。你当然可以作弊,让人工智能测试所有可能的动作,并找到隐藏的船只 X 向前移动,但我想说这是违反规则的。 然后人工智能总是会找到这艘船并且总是会命中,这也会让对战变得非常无聊。
The minimax algorithm needs some sort of evaluation of the gamestate in every node. In battleship you don't have all information as a player or AI (opponent ships are not known) which makes it impossible to do this. You could of course cheat and let the AI test all possible moves and find the hidden ships X moves ahead, but I would say this is against the rules. The AI would then always find the ship and always make hits which would also make it very boring to play against.
You can find some inspiration for example here on other algorithms to use.
发布评论
评论(1)
简短的回答:不。
极小极大算法需要对每个节点中的游戏状态进行某种评估。在战列舰中,你没有作为玩家或 AI 的所有信息(对手的舰船是未知的),这使得你不可能做到这一点。你当然可以作弊,让人工智能测试所有可能的动作,并找到隐藏的船只 X 向前移动,但我想说这是违反规则的。
然后人工智能总是会找到这艘船并且总是会命中,这也会让对战变得非常无聊。
您可以在此处找到一些有关其他算法的灵感使用。
Short answer: No.
The minimax algorithm needs some sort of evaluation of the gamestate in every node. In battleship you don't have all information as a player or AI (opponent ships are not known) which makes it impossible to do this. You could of course cheat and let the AI test all possible moves and find the hidden ships X moves ahead, but I would say this is against the rules.
The AI would then always find the ship and always make hits which would also make it very boring to play against.
You can find some inspiration for example here on other algorithms to use.