CS 115 Project 3, Spring 2015:
Hangman


Summary

In this project, your program will play a series of interactive, graphical games of Hangman with the user.

Due dates

Checkpoint ADue as an in-person demo in tutoring, lab, or workshop; see the Moodle schedule for times. Your last chance is the workshop on Thursday, April 23.
Checkpoint BDue as an in-person demo in tutoring, lab, or workshop; see the Moodle schedule for times. Your last chance is the workshop on Thursday, April 30.
Final codeDue on the CS department server (see Moodle instructions), on Tuesday, May 5 at 11:00 PM

How Hangman Works

Hangman is a guessing game in which one player (or the computer) thinks of a word, and the other player tries to fill in the letters of the word. The game is over when the word is entirely filled in or when the guessing player reaches 6 incorrect guesses. The player's current number of incorrect guesses is illustrated by drawing a part of a hanging man with every incorrect guess; when the drawing is complete, the guessing player loses.

Useful terminology for our program:


Support and input files

Graphics library

Because this program is graphical, you will need to run it using IDLE on your local machine. Download graphics.py into your Python directory.

Support code

I have provided you with a support file containing the window size and a function to choose a word from the dictionary. You should download this code (hangman_support.py) into your project directory. You should not modify this file, since we will use our own version when we grade your submission.

You should write your code in a separate file. To use the starter code, add the following line to your file:

from hangman_support import *

This will allow you to refer to the WINSIZE variable and to call our choose_word function.

Word list

The user will create a file called hangman.txt in the same directory as your program. This file will contain a list of words. When we test your program, we will use our own copy of this file. You should consider this file as part of your user's input and test it accordingly.

The file proj3_list.txt, which is the official Scrabble dictionary minus some offensive words, will be useful for testing. Right-click to download it into your Python directory.

Word list specifications

Word list hints


Checkpoint A (7 points)

Specification

Your program should read the hangman.txt file and print all of the valid words in that file (one per line) to the console (text) window.

Your program should ask the user if they want to play a game of Hangman:


Checkpoint B (8 points)

For each game of Hangman, your program should do the following:


Final Code

For the final code, you will extend your checkpoint code in 2 ways:

Example stick-figure hangman


Grading

Correctness [55%]

The most important part of your grade is the correctness of your final program. Your program will be tested numerous times, using different inputs, to be sure that it meets the specification. You will not get full credit for this 55% unless your output is grammatically correct, correctly spelled, and professional.

Programming Design and Style [30%]

In addition to being correct, your program should be easy to understand and well documented. The grade sheet is identical to the Project 2 style grade sheet:
http://rivoire.cs.sonoma.edu/cs115/proj/cs115_p2_rubric_partial.html

Note that there is an automatic style checker on cwolf that can check some aspects of programming style for you. For details, see the grading sheet link.

Checkpoint [15%]

Your checkpoints are worth a combined 15 points, as described above. The checkpoints cannot be submitted late.

Extra credit [up to 5 points]

There are lots of possibilities to extend this project for extra credit; getting crazy with graphics is one clear option. If you have an idea you'd like to implement, run it by Dr. Rivoire.


Submitting your final code

If your project code is on your computer, you must copy your final code to the CS department server using FileZilla BEFORE following the instructions in the next paragraph. Every lab has instructions on how to do this.

Once your project code is on the cwolf server, you must submit it for grading by logging onto cwolf and running this command:

~srivoire/bin/submit 115

Type P3 when prompted for the assignment, and then type the name of the file you want to submit. Be sure that you confirm your submission by visiting
http://rivoire.cs.sonoma.edu/cs115/submit/proj3.txt
and looking for a file with your name, your cwolf username, and the correct timestamp.

You may resubmit as many times as you like, and only the last submission before the due date will be graded.

Collaboration policy

Programming projects must be your own work, and academic misconduct is taken very seriously. You may discuss ideas and approaches with other students and the course staff, but you should work out all details and write up all solutions on your own. The following actions will be penalized as academic dishonesty:

Late policy

There is a 48-hour grace period associated with the final project deadline. This grace period is designed to cover small personal emergencies and other unexpected events. No other consideration will be given for these small emergencies.