Evil Hangman is an assignment in which students write a computer program that cheats at the classic game Hangman. Normally, when writing a computer to play Hangman, the computer picks a single word and accurately represents it as the human player tries to guess all of the letters in the word. In Evil Hangman, the computer instead maintains a list of every word in the English language, then continuously pares down the word list to try to dodge the player's guesses as much as possible. Human players tend to fare terribly against this conniving silicon foe!
We use this assignment in both CS1 and CS2 courses, Python and Java. It's a hit. But we renamed it Clever Hangman rather than calling it Evil Hangman. Link below to the Python writeup. Java/CS2 version is still in development.
This was easily the hit of 2011 -- simple, brilliant, and rich. We're using it in our Beauty and Joy of Computing course as the central problem to teach non-majors (using BYOB based on Scratch) list manipulation and basic algorithm design. Student approaches usually fall into two categories (1) keep a filtered list around that always satisfies the current pattern [thus you don't have to remember the past guesses since the filter did it for you], and (2) keep a current word around and all the old guesses which are used to pick a new word if one of the letters in the current word are chosen.
We also break the problem down into three separate steps (separate homework)
Comments
We use this assignment in both CS1 and CS2 courses, Python and Java. It's a hit. But we renamed it Clever Hangman rather than calling it Evil Hangman. Link below to the Python writeup. Java/CS2 version is still in development.
http://www.cs.duke.edu/courses/spring12/compsci101/assign/cleverhang/
This was easily the hit of 2011 -- simple, brilliant, and rich. We're using it in our Beauty and Joy of Computing course as the central problem to teach non-majors (using BYOB based on Scratch) list manipulation and basic algorithm design. Student approaches usually fall into two categories (1) keep a filtered list around that always satisfies the current pattern [thus you don't have to remember the past guesses since the filter did it for you], and (2) keep a current word around and all the old guesses which are used to pick a new word if one of the letters in the current word are chosen.
We also break the problem down into three separate steps (separate homework)
In summary, this is one of the best Nifty's in a long time; Keith authored a doosy!
Dan Garcia and the rest of the folks at Beauty and Joy of Computing at UC Berkeley