You have discovered that your old hangman game was a bit too easy and all of the kids at school are making fun of you for it. You come up with a brilliant but very secretive idea: you are going to modify your game into a new version that you have appropriately named Evil Hangman.
This assignment is due at 11:59 PM on Friday as listed on the course calendar via bSpace. |
You absolutely must work with one other person on this assignment. Your partner may be from any section of CS10. You can ask around in lab or on Piazza to find a partner.
Evil Hangman is played in exactly the same way as the original game. In fact, the player should have no idea that they are not playing the original game. The difference, however, is that the computer is actually cheating to make the game as hard as possible for the player. The computer does not actually settle on a word until the very end of the game. It tries to keep the player in the dark for as long as possible. Instead of picking a word at the very beginning a la regular hangman, the computer chooses a word but readily changes to a different word if the player starts guessing letters correctly.
A flowchart describing one possible approach below is available here.
The dialogue between the player and computer should look exactly the same as it did in your last assignment. In fact, it will probably be in your best interest to start from your project that you submitted as Homework 2. We have also provided a few word lists (see below), but you are welcome to use your own for testing if you prefer. You can test your program on the 2000 words list before convincing yourself that your program completely works. However, your homework submission must have the 1000 words list set as the default words list.
Your program should continue to switch letters as long as there are words available given the letters guessed and your code's choice of whether to keep words with that letter in a specific place or to discount all words with that letter in it. Note that you should not worry about making your program work as efficiently as possible since you will not be graded on your homework’s performance in terms of speed. You will only graded on correctness.
NOTE: A "letter pattern" refers the positions that will be revealed in a word if a particular letter is guessed. For example, _ p p _ _ is one way to represent the letter pattern for "p" in the word "apple." The idea here is that even after you revealed a letter, you may still be able to pick another word.
Remember that, when played well, it should be possible to win a game of Evil Hangman. The computer may not cheat!
There are many slight variations on the game of Evil Hangman. Below is a video of the way Evil Hangman should be played. It includes an overview of the basic algorithm, and some examples.
Click here to watch a video of the gameplay.
Click here to view the slides used in the above video.
––– Special Extra Credit Opportunity –––
There are a few options for earning extra credit on this assignment. If you would like to earn this particular type of extra credit on this assignment, you must format your Homework 3 in such a way as explained here. The extra credit you will receive for this falls under item 2 of the Extra Credit Opportunity section below.
You can either start with your submission for HW2 or our solution to HW2.
Using the HW2 solution, you will be given 3 different word lists and some blocks. A description of what you will find in your starter file is listed below:
In order to receive full credit, there are a few simple requirements which you must meet. Refer to this list as you complete your Homework 3.
You will submit your Homework 3 on bSpace to the Homework 3 assignment slot. Only one person from each group should submit your assignment.
Your submission must contain two items:
(These are not required, but may prove extremely helpful!)
Extra credit is available for Homework 3! Please make sure to let us know if you are implementing extra credit by adding a comment beneath your list of your partner names and SIDs in the bSpace comments box when submitting your assignment.
(NOTE: Your Homework 3 assignment will still be graded by a human! This option is geared towards helping us develop new options for an online version of CS10.)
CS10: The Beauty and Joy of Computing -- HW3 -- Evil Hangman