CS 341 - Survey of Programming Languages
Homework #8

Due: Thursday 11/17 at the beginning of class

Note: This work is to be done in groups of 2

Choose Your Own Perl Adventure

The goal of this assignment is to allow for a fun task to both allow practice of fundamentals learned in class and motivate self-directed learning of Perl beyond these fundamentals.  Since there are diverse interests, there should be diverse goals allowed for this assignment.  At your option, you may

  1. Implement perl Hangman (described below),
  2. Study and exercise perl bioinformatics skills (described below), or
  3. Propose your own Perl project (at the level of a substantial CS111 project; guidelines below).

Perl Hangman

Call your perl program hangman or hangman.pl.  In the game of Hangman, one guesses letters of an unknown word, which are revealed in their correct positions in the word when correctly guessed.  The player is allowed 6 incorrect guesses.  On the 7th incorrect letter guess, the player loses and the word is revealed.  If the player guesses a letter which has been guessed before, the mistake is reported and it is not counted as an incorrect guess.  Bad input is ignored.  On each turn, the player sees:

Here is a transcript of play.

Here's some relevant sample code to start you off.  Your program should use the ENABLE dictionary which is located in /Courses/cs341/dictionary/.  For ease of grading, please DO NOT copy the dictionary, assume the dictionary is in a non-standard location, or submit the dictionary.

Longer words tend to be easier than shorter words for a fixed number of guesses.  I recommend that you allow the user to select the length of the word to be guessed.  One simple means of adapting to the player's abilities is to decrease/increase the length of the mystery word after 3 consecutive wins/losses.

Perl Bioinformatics

One Perl bioinformatics book that meshes nicely with our Perl coverage and does not require deep knowledge of genetics is "Beginning Perl for Bioinformatics" by James Tisdall.  It is available from Safari online.  If you choose to do a short study of bioinformatics with perl, you should:

Propose Your Own Project

Project selection and design is an art.  If you have another project idea to propose be sure that it would be challenging enough to provide opportunities to exercise all of the Perl fundamentals we've covered, and be modest enough to be feasible in the given limited time frame.  Be in close conversation with me, and do not forget to have your idea approved by 11/10 if you choose to go this route.