from game_state import GameState
class TippyGameState(GameState):
def __init__(self, p, interactive=False, current_total = 0):
GameState.__init__(self, p)
if interactive:
self.size = int(input('Map size?')
self.current_total = self.size * self.size
self.size = 3
self.over = (current_total < 1)
当我在终端中运行它时,它始终显示从self.current_total = self.size * self.size
到结尾的语法错误,有人可以告诉我原因吗?
答案 0 :(得分:2)
替换
self.size = int(input('Map size?')
到
self.size = int(input('Map size?'))
答案 1 :(得分:0)
在这种情况下,请尝试查看上一行。
将self.size = int(input('Map size?')
替换为self.size = int(input('Map size?'))