我当时在写单曲人工智能,但我在玩扑克牌时遇到了一个问题。我想要人工智能选择最好的颜色,选择在一个外卡,由他的手牌,但我不知道怎么做。
卡片是一个有脸串和颜色枚举的类。
public class Card
{
public CardColor Color { get; set; }
public string Face { get; set; }
public Card(CardColor color, string face)
{
Color = color;
Face =
我用Python制作了一款战舰游戏。目前,游戏有一个简单的人工智能,随机猜测一个点,它还没有在董事会上猜测,试图找到两块大型战舰。我是让人工智能更聪明,给它一个模式,以遵循。要生成AI的猜测,我使用以下代码。
while X == 0 | Y == 0:
X = 0
Y = 0
guess_col = guessCol(0, size - 1)
guess_row = guessRow(0, size - 1)
# Make sure the guess follows the pattern
if (guess_col + gues