这是我在编程方面的第一节课,我遇到了一个问题,我真的不知道如何继续。在def defeat_balrog(protagonist):
def spawn_balrog():
"""Spawns and returns a stubborn balrog"""
pass
def balrog_attack(balrog, person):
"""Returns an attack move from the balrog's repertoire"""
pass
cave_balrog = spawn_balrog()
is_balrog_defeated = False
yell(protagonist, 'You cannot pass!')
while not is_balrog_defeated:
current_attack = balrog_attack(cave_balrog, protagonist)
if current_attack != None:
take_defensive_action(protagonist, current_attack)
yell(protagonist, 'YOU SHALL NOT PASS!')
take_offensive_action(protagonist, cave_balrog)
is_balrog_defeated = True
return True
def take_defensive_action(attacked_entity, attack_move):
"""
attacked_entity anticipates attack_move and defends himself.
"""
pass
#my stubs here#
defeat_balrog('gandalf')
我应该标识出已经被心甘情愿地使用的剩余函数,但是还没有为它们创建存根,然后从最后一行“我的存根在这里”中填写。不知道如何开始或继续。在