Have you ever played the board game “Mastermind”?
If you are not too sure about the rules of this game, you should first check this page.
For this challenge we are going to create this game of mastermind where the end-user plays against the computer. The end-user’s role is to guess the choices of 4 colours made by the computer.
Learning Objectives
By completing this game we are using all our coding skills using nested loops and IF statements.
We are also learning about how flowcharts can be used to describe a complex algorithm.
Flowchart
Can you create the flowchart for this computer game yourself?
Give it a try. Once done, compare your flowchart with our flowchart:
Note that there is often more than one approach to solve a problem.
Code
Use either your flowchart or the one given above and translate it into programming code using Python.
Solution...
The solution for this challenge is available to full members!Find out how to become a member:
➤ Members' Area