Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Cyber Battle Game
Game elements
Main Game Loop
Final game
23. Step 10b – final touches

Instruction

Great! We're almost done with our game. We just need to add the final touches.

Exercise

The last bits we're missing are:

  1. In play_round(), after both robots performed their actions, do the following:
    • Print the board
    • Print robots' lives
    • Clear all laser beams.
  2. In the main() function, before the while loop, print the initial board state and the lives left.
  3. At the end of your code, invoke the main() function.

Stuck? Here's a hint!

Ad. 1: Type the following code inside the play_round() function.

print_board(board, robot_a, robot_b)
print_lives(lives_left)
clear_lasers(board)

Ad. 2: Use the print_board() and print_lives() functions with accurate arguments before the while loop.