I’m working on a python exercise and need an explanation to help me learn.Choose one of the projects below.
• Design and program must be object-oriented.
• They should all be user-friendly and robust, being able to deal with user input errors;
however, don’t go overboard, get it working first!
Projects:
1. Hangman (using graphics)
Design and implement a simple version of the classic game Hangman using
graphics library cs1graphics.
As the heart of your program, implement a function play Hangman(secret) that
manages a single round of the game. The parameter is presumed to be a string
which is the secret answer; consider it unknown to the player.
The game should begin by displaying a version of the answer with the original
spacing and punctuation, but each alphabetic character replaced by an underscore
‘_’ character. Then start asking the player to enter a single character as a guess.
If
that character is hidden in the answer, inform the user of his success and re-display
the disguised message but with all occurrences of the letter displayed. If the guess
was wrong, inform the user – draw the next part of the body. The wrong guesses
should be displayed too.
This process should continue either until the entire message has been uncovered or
until the full body is drawn (number of guesses reached the limit). At the end of
each game user should be prompted for another round of the game.
2. Tic-Tac-Toe (using graphics)
Design and Implement a Tic-Tac-Toe game where you can play against another
person, using graphics library cs1graphics.
Starting the design: – it looks good to have
a TicTacToe class (which will be taking care of one game);
an Input class which will take care of the input
an Output class (which will take care of the displaying one turn of the game).
Maybe some other classes appear as “good to have” as soon as you start thinking
of what should be in each of the above class.
CSI 31 Final Project Lists
3. Towers of Hanoi (solved by Recursion) (using graphics)
The game begins with three pegs and a tower of n disks on the first peg, stacked
from largest at bottom to smallest at top. The goal is to move them all to the third
peg, moving only one disk at a time. Moreover, you are not allowed to place a disk
on top of a smaller disk. Write a program that generates a solution to the problem +
show it graphically.
With three disks, the puzzle can be solved in seven moves:
Requirements: doesn’t matter