A computer game needs to be developed. It is a computer vs player game, ROCK, SCISSORS, PAPER
Watch Part A of the Case Study and follow along by coding the game.
Attempt to solve the logic problem when updating the score for the game.
You can compare your solution with the case study's when you watch Part B.
Now watch Part B of the case study.
It will introduce how the function to get the player's choice will work.
It will decompose the problem into a series of steps.
Your challenge will be to code the steps!
Test your program and perform corrective maintenance to fix any syntax or other errors.
Save it as tictactoe-1.py in a prject folder.
Open your project file and save it as tictactoe-2.py in your project folder. You should now have 2 files.
Adapt your game as follows:
It is the same as before except if the player and the computer throw the same symbol, then a function getBonusNumber is called.
This function is passed the symbol as a parameter eg if both players threw rock then rock is passed as a parameter.
If the symbol is rock, the function returns the value 3.
If the symbol is scissors, the function returns the value 2.
If the symbol is paper, the function returns the value 1.
This number is added on to both players scores.
The first player to reach 10 points is the winner of the game.
Here is a simulation of the new game:
decompose function subroutine return parameter assign call program corrective maintenance adaptive maintenance