Instruction
Great job! Our code is almost ready!
Exercise
We need to change our functions a little:
act_robot(): Addboardas the first variable of the function. Then, instead of printing the robot and the words "right", "move forward" or "laser shoot", invoke the actual functions you wrote previously – theturn_right(),laser_shoot(), andmove_forward()functions.- Add
boardas the first argument in theplay_round()function. Remember to pass aboardwhen invoking the function in the main loop.
Stuck? Here's a hint!
Your act_robot() function should look like this:
def act_robot(board, robot, lives_left):
action = random.randint(0, 2)
if action == 0:
turn_right(robot)
elif action == 1:
laser_shoot(board, robot, lives_left)
elif action == 2:
move_forward(board, robot)



