Project Assignment 1 - 2006 Session
The Assignment
Due in class Thursday 9 Feb, Project students only
Your task is to write a lisp (scheme) program that takes a list of words (represented as symbols, not strings) and performs some sort of interesting transformation on it by swapping words, inserting words, replacing words, etc. There are many specific tasks that your program could perform, many of which would have an almost identical general structure:
- Create a simple ELIZA-like mapping that repeats things back at you with appropriate first/second person changes. For example: {{{(i am going to my school today)
==> (you are going to your school today)}}}
- or, even better {{{(i am going to my school today)
==> (why are you going to your school today)}}}
For more information on ELIZA, one of the earliest (if not the brightest) conversational AI programs, read the original paper or try out one of the online implementations here or here
Translate sentences into 1337 ones by replacing certain words (or characters if you like) with their 1337 equivalents. You may find the scheme builtin functions string->list and list->string helpful for this task. (Look them up in Dybvig.)
Pass in a story with NOUN, VERB, ADJECTIVE, etc., symbols to be replaced with options from choices that you define. aka do madlibs. Here, the random function may be helpful (Unfortunately not in Dybvig, but in your Dr. Scheme manual or the MIT Scheme manual, among other places).
- Replace variables in a symbolic representation with real numbers (i.e., if you set it up so that x is 3 and y is 4 then your program would transform {{{(+ x (- 5 y))
==> (+ 3 (- 5 4)) }}}
.. BONUS: You could then use eval... )
If you finish this basic functionality, and want some additional ways to extend your project, here are some ideas:
Create an input/output loop that processes multiple inputs interactively (investigate read and display primitives)
Implement (more of) the actual ELIZA rules (A page on ELIZA)
- Find the appropriate PLT-scheme libraries to connect your creation up to a chat client...
Resources
If you get stuck with syntax or "how to do things" along the way, there is an excellent Scheme tutorial that I've found very helpful called Teach yourself Scheme in fixnum days. There are also even more resources available for you in ReadingRoom/SchemeResources page. If you still can't figure out what you need or just want more human help, come talk to Sean.