CS 5010 F '09
 
Pair Programming
The Recipes
The Style
Subversion
Assignments
Set 1
Set 2
Set 3
Set 4
Set 5
Set 6
Set 7
Set 8
Set 9
Set 10
Set 11
Set 12

Problem Set 9

logo

Due date: 11/18


Purpose:

This goal of this project is to apply your design skills to the solution of a reasonably large class project.

Drill:

Use the universe teachpack to design hangman. The function consumes a string and creates a "hangman world", producing true as the answer. A player can then enter a character via the keyboard. The world program checks whether the character occurs in the chosen word and where. If so, the occurrences of the character are revealed. Otherwise, the hangman world program draws another limb of a hangman. Here is how I did with (hangman "hello"):
hangman

You are free to design the details of the hangman; you may even display the words instead of drawing it, but your program must allow for at least seven incorrect guesses.

Turn Hangman into a distributed game, also using the universe teachpack. See last year's problem sets for a protocol.


Required Problems:

Note: You must use the Intermediate Student Language with Lambda.

  1. Design a "quick chat" system. This universe program allows people to "chat" with each other, i.e., to exchange short "one line" messages. A participant uses a chat space, which is a window divided into two spaces: the top half for listing the messages received and the bottom half for listing the messages sent plus the one message the participant is currently entering. The two halves display the messages in historical order, with the most recent message received/sent at the bottom. When either half is full of messages, the least recent line of the respective part is dropped.

    a chat space

    The snap shot above shows the chat space for a participant who has received one message from someone called "carl" (see red name in top half) and who is about to send said "carl" a reply.

    Each message is at most one line of text, which is the width of the window. That is, a message is sent when the line is one character too wide for the screen or when the user hits "\r" (return).

    A line in the chat space consists of two pieces: an address and a message, where the former is separated from the latter with a ":". The user sends a message by typing the name of a participant, followed by ":" and the text of the message. Once the ":" is entered, it becomes impossible to change the recipient. The rest of the line is the message.

    A message whose recipient is "*" is broadcast to every current participant. Otherwise a message is sent to the designated recipient, if the string is the valid name of a current participant; all other messages disappear in the big empty void.

    Each received message is displayed like those that are sent, with an sender followed by ":" and the text of the message. If the message went to all participants, the sender's name is followed by an asterisk "*" before the ":".

    As you work on this project, you will encounter questions for which this problem statement doesn't provide enough information to make decisions. You must make the decisions on your own, following this procedure:

    • do not opt for answers that render the project trivial
    • document all non-trivial answers and the answer you chose
    • provide a reason for your choice
    Be concise.

  2. You may use the universe teachpack as well as the image-ops teachpack.


last updated on Wed Dec 2 17:58:10 EST 2009generated with PLT Scheme