bot.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:Hanabi-AI 作者: MeGotsThis 项目源码 文件源码
def update_game_state(self) -> None:
        c: Color
        v: Value
        discards: Dict[Color, List[int]]
        discards = {c: [0] * 6 for c in self.game.variant.pile_colors}
        d: int
        for d in self.game.discards:
            ci: CardInfo = gameCards[d]
            discards[ci.color][ci.value] += 1
        self.nextCardPlay: Dict[Color, int]
        self.nextCardPlay = {c: len(self.game.playedCards[c]) + 1
                             for c in self.game.variant.pile_colors}
        self.maxCardPlay: Dict[Color, Value]
        self.maxCardPlay = {c: Value.V5 for c in self.game.variant.pile_colors}
        for c in self.game.variant.pile_colors:
            for v in reversed(Value):  # type: ignore
                if discards[c][v] < v.num_copies:
                    self.maxCardPlay[c] = v
                    break
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号