For my high-level Python program, I chose creating a text-based version of the popular board game Mastermind.
HOW TO PLAY
The player has 10 chances to guess the secret number code.
1. Set difficulty by inputting number.
a. Determines length
2. You can have code length of 10 ints.
3. 10 Chances to guess the secret number.
4. Program keeps track of
a. Numbers placed in the correct place
b. Numbers correctly guessed
c. Number of guesses left.
Beginning this project, I was nervous as to whether I would be able to code such a game as Mastermind. Fortunately, Python’s simple syntax was pretty easy to understand. I was able to adjust to Python’s syntax and begin coding.
My impression of Python is that its so much easier to code in than Java. Of course I made rookie mistakes along the way, importing libraries that weren’t necessary, etc.
My biggest challenge was somewhat self-inflicted: I tried converting my Python 2.73 code to 3.22 (the most current version). When I ran the program, I was able to set the difficulty. However, when I entered a combination, I got the error illustrated below:
The above error message pointed to the line of code below circled:
Unfortunately after hours of research, I couldn’t find a solution. Welp…at least I was able to get my Python 2.73 code working.
Here’s a link to higher-quality screenshots from above
Here’s a link to the code.
***View the latest post for the PowerPoint presentation I gave during class.***