Teaching
2500 F '11
 
Assignments
The Hand In
Set 1
Set 2
Set 3
Set 3h
Set 4
Set 4h
Set 5
Set 5h
Set 6
Set 7
Set 6h
Set 8
Set 7h
Set 9
Set 8h
Set 10
Set 9h
Set 11
Set 10h
Set 12

Problem Set 10h

Due date: 12/6 @ 11:59pm

Programming Language: Intermediate Student Language with lambda


Final HW Assignment

The goal of this problem set is to practice the design of generative recursive functions, accumulator-style functions, and to design distributed programs and evaluators. Start early, these are some tough problems.


HtDP Problems:

Solve problems 28.2.1, 28.2.2, 28.2.3, 28.2.4, 31.3.4, 31.3.7.

RacketBot — Racket as a Chat User:

Using the chat program you developed in in lab and the evaluator we developed in class, write RacketBot: a program that poses as a chat user. When RacketBot is sent a message that is an expression, it should evaluate it and reply with its result.

You must first implement excercise 7 from lab, which adds private messages. When RacketBot receives a private message addressed to it, it should try to read the message as an s-expression and evaluate it. If the s-expression is a valid program, it responds with a private message to the original sender with the result of evaluation. If the message is not a valid program, RacketBot should respond that it did not understand.

The string->sexp function will come in handy, which given a string produces the corresponding s-expression, if there is one, and false otherwise. To add this function, save the string-to-sexp.rkt file to your homework directory and include (require "string-to-sexp.rkt") at the top of your program.

As an extra bonus worth no points: can you think of a message that you could send RacketBot that would make it totally unresponsive so that it never responds to your message, or anybody elses? Note that RacketBot, if designed properly, should never crash; but that doesn't mean it can't become very, very busy.


last updated on Tue Nov 29 19:02:43 EST 2011generated with Racket