Instruction
Good! Let's focus on putting our game into motion. We need to create the main game loop. Inside the loop, we'll play all the game rounds. The main loop will also be responsible for checking if the game has already ended.
Both robots start with two lives. The game lasts until either
- a robot has no lives left, or
- 10 rounds have passed.
Exercise
- Create a dictionary named
lives_left. It should have two keys,'A'and'B'. Both keys should have the value of 2 initially. - Create an integer variable named
rounds_leftthat is equal to 10. - Create the main game
whileloop with the following logic: while both robots have more than 0 lives and there are more than 0 rounds left, invoke theplay_round()function. Once a round has been played, decrease the value ofrounds_leftin thewhileloop by 1. - Robots can't lose lives yet, so after the whole loop has finished, print:
*** Draw! ***
Stuck? Here's a hint!
Your while loop should look like this:
while lives_left['A'] > 0 and lives_left['B'] > 0 and rounds_left > 0:
Remember to decrease the value of rounds_left inside the while loop. Print *** Draw! *** outside the while loop.



