CSC207 - Project 2
Prolix

Assigned Oct 17th 12 p.m.
Due October 26th 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 Prolix, designed and used with permission by Gil Hova.

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

Description

Prolix is a word game where players compete to find words using a weighted mix of consonants. The full rules are available online and more information can be found at BoardGameGeek and Z-Man Games.

A solo game of Prolix lasts 6 rounds. Each round, you are trying to come up with the best word for the current board.

Letter tiles are shuffled into a bag, and then drawn out and placed on the board. There are five each of the letters B, C, D, F, G, H, L, M, N, P, R, S, and T, two each of K, V, W, and Y, and one each of J, Q, X, and Z.

As letters are placed on the board, you must ensure that there are no more than two non-common letters out on the board at any time, nor can you have more than two of the same letter out on the board at any time.

There are always eight letters on the board, divided into four columns. The two leftmost columns score 4 points each, the third column scores 3 points, and the fourth column scores 2 points.

V (+1) G F S
J (+2) B H T
4 points 4 points 3 points 2 points

When you enter a word, you score points based on how many letters you used from the board. You don't need all the letters in your word to be on the board in order to use that word. Your word can be as long as you'd like. The letters don't need to be in any particular order.

As seen above, some letters are rarer than others. For these rare letters, there are fewer letters that come out onto the board, but they give you bonus points if you use them. K, V, W and Y are worth one extra point, and J, Q, X, and Z are worth two extra points.

V (+1) G F S
J (+2) B H T
4 points 4 points 3 points 2 points

For example, the word "subjective" scores 19 points on the board above. Note that the V and the J score bonus points.

You only get to use each letter once for each letter in your word. If a letter is repeated in your word, you can only score the extra letters if there are corresponding extra letters on the board.

Each round, your total score for the game must meet or exceed a minimum score.

Round Minimum Score
1 15
2 31
3 48
4 66
5 85
6 105

If you don't make the minimum score for a round, you immediately lose the game.

If you do make the minimum score for a round, you get to play another round. The letters on the board move two spaces to the right, and four new letters are drawn into the two leftmost columns.

You are not allowed to re-use any word you already used, so keep a list of used words.

If you have 105 points or more at the end of the game, you win!

Coding

For this assignment we will be writing a Python program to let a user repeatedly play solitaire Prolix.

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

  1. Tell the user about the game.
  2. Shuffle the letter tiles to create the initial board, and display this to the user.
  3. For six rounds, ask the user what word they would like to use. Make sure the user inputs a valid English word.
  4. Calculate the score for this word. If the cumulative score is too low for that round, end the game.
  5. If the cumulative score is high enough, shift the tiles and refill the board for the next round.
  6. If the user makes it through all six rounds, congratulate the user!
  7. Ask the user if they would like to play again. If so, return to step 1.

Your code should make good use of functions, as there are clear pieces of the game which are repeated. 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.

Extra Credit

Write a function that calculates the three highest scoring words that could be created from the current board. Print these words along with their scores to the user after they have finished their turn.

What to Hand In

Log in to cs.centenary.edu through either Secure FTP or WinSCP using your cs login and password. Copy your prolix.py project into the project2 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 2011, with rules from Gil Hova, Centenary College of Louisiana