CardsAgainstHumanity.py 文件源码

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

项目:CorpBot.py 作者: corpnewt 项目源码 文件源码
def botPick(self, ctx, bot, game):
        # Has the bot pick their card
        blackNum  = game['BlackCard']['Pick']
        if blackNum == 1:
            cardSpeak = 'card'
        else:
            cardSpeak = 'cards'
        i = 0
        cards = []
        while i < blackNum:
            randCard = random.randint(0, len(bot['Hand'])-1)
            cards.append(bot['Hand'].pop(randCard)['Text'])
            i += 1

        await self.typing(game)

        # Make sure we haven't laid any cards
        if bot['Laid'] == False and game['Judging'] == False:
            newSubmission = { 'By': bot, 'Cards': cards }
            game['Submitted'].append(newSubmission)
            # Shuffle cards
            shuffle(game['Submitted'])
            bot['Laid'] = True
            game['Time'] = currentTime = int(time.time())
            await self.checkSubmissions(ctx, game, bot)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号