uttt.py 文件源码

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

项目:uttt_engine_standalone 作者: smiley1983 项目源码 文件源码
def game_over(self):
        """ Determine if the game is over

            Used by the engine to determine when to finish the game.
            A game is over when there are no players remaining, or a single
              winner remaining.
        """
        if len(self.remaining_players()) < 1:
            self.cutoff = 'extermination'
            return True
        elif len(self.remaining_players()) == 1:
            self.cutoff = 'lone survivor'
            return True
        elif self.game_won() == DRAW:
            self.cutoff = "Board full"
            return True
        elif self.game_won() != EMPTY:
            self.cutoff = "Game won"
            return True
        elif self.count_active() < 1:
            self.cutoff = "No more moves"
            return True
        else: return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号