On this page:
1 Extended Yo
2 Project submission

Assignment 11: Yo++

Due: Monday, December 11, 11:59:59 PM EST.

The following should be completed in cooperation with your latest assigned partner, which were newly assigned on Oct 23. (Partner assignments are listed on Piazza.) You may not share code for this assignment with anyone but your partner.

You must use the design recipe and The Style guidelines to receive full credit.

1 Extended Yo

This assignment deals with revisiting the Yo application developed in class December 4, 2017.

You may start from the code provided after the lecture, including a complete implementation of the client, which was only partially developed in lecture.

Here is a demo of the server and three clients running:

Your task is to extend the client program to work more like a traditional chat client, allowing the user to type any message, not just "yo".

Add a text box to the bottom of the window that allows the user to type a message, which is sent to the currently selected user when they press the Enter key. (You may want to revist some of the early Labs that dealt with text boxes.)

The client should have different modes for selecting a user and selecting the text box to type (otherwise you won’t be able to write messages containing "1" for example). It’s up to you to design and represent these modes.

Your program must define two functions with exactly these names and signatures:

; handle-receive : World SExpr -> HandlerResult
; Receive a message from the server
 
; handle-key : World KeyEvent -> HandlerResult
; Receiver keyboard input from the user

We will use these functions to test your program. They should work for arbitrary interactions with the server and user.

You should only need to modify the client; the server is not actually dependent on the message being "yo". When we test your client, we will not use your server so if your client is dependent on changes you make to the server, tests will likely fail.

2 Project submission

Submit a single file named chat-client.rkt that implements the revised client program.