bot.py 文件源码

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

项目:Hanabi-AI 作者: MeGotsThis 项目源码 文件源码
def isNowPlayable(self,
                      color: Optional[Color],
                      value: Optional[Value]) -> bool:
        '''Returns True the color and/or value is playable'''
        assert color is not None or value is not None
        if color is not None and value is not None:
            return self.isPlayable(color, value)
        if color is not None:
            playableValue = len(self.game.playedCards[color]) + 1
            if (playableValue <= 5
                    and not self.locatedCount[color][playableValue]):
                return True
            return False
        if value is not None:
            for c in self.colors:
                if (len(self.game.playedCards[c]) + 1 == value
                        and not self.locatedCount[c][value]):
                    return True
            return False
        assert False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号