funfun.py 文件源码

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

项目:chainer_pong 作者: icoxfog417 项目源码 文件源码
def act(self, observation, last_reward):
        if len(self.fun) == 0:
            print("\nFUN", end="")
            fun_length = random.randint(5, 15)
            self.actions = self.actions[::-1]
            self.fun = sum([[a] * fun_length for a in self.actions], [])
        elif self.fun[0] == self.actions[0]:
            print(">" if self.fun[0] == 2 else "<", end="")

        action = self.fun.pop(-1)

        if last_reward > 0:  # lose
            print("TENSAI!!!!!")
            self.fun = [0] * 5  # stop a while to shout

        return action
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号