CSC207 - Project 2
The Word of the Day

Assigned Oct 19th 12 p.m.
Due October 28th 5 p.m.


Overview

For this project, we will explore more complex interactions with the user by implementing control statements and loops. We will create a program for one user to play the game COMBINATION.

In particular, this project will cover the following concepts we have discussed in class:

Description

The game of COMBINATION is a timed exercise similar to Boggle. A player is given a word and a time limit, and the player must write down all possible words of three letters or more that can be made using the individual letters in the original word. At the end of the time limit, a player's score is the number of unique words they found divided by the total number of possible words. A letter can only be used once, unless there are multiple copies of the letter in the original word.

For example the player is given the word JUDGING. In the course of a minute, the player identifies

dig
gun
jug
ding

The player missed the following words:

din
dug
dun
dung
gig
gin
gnu
jig

for a score of 4 / 12 = 33%

Coding

For this assignment we will be writing a Python program to let a user play a timed version of COMBINATION.

Download the text file english-words.txt and the python module dictionary.py files.

You must create a python program called combination.py. It will:

Your code should make good use of functions, as there are clear pieces of the game which are common to all the above variants. Additional dictionary functions should be added to dictionary.py. Using functions will reduce the amount of code you need to write as well as make your program easier to debug. However, do not write spaghetti code, where functions call each other back and forth to continue execution of the program; let your functions naturally return values and use loops to repeat the game turns.

Your code must check all user input for validity and reprompt them for correct input if any mistakes are made.

What to Hand In

Log in to cs.centenary.edu through either Secure FTP or WinSCP using your cs login and password. Create a subdirectory from csc207 called project2. Copy your combination.py project into this directory, along with any other files you need to run your code. Make sure you have followed the Python Style Guide, and have run your project through the Automated Style Checker.

You must hand in:

and any other files necessary to run your code.
© Mark Goadrich 2009, Centenary College of Louisiana