CS 1102 (A16) Individual Project
Implementing an Animation Language

Phase 1 (design) due Monday, September 26 (11:59pm)
Phase 2 (implementation) due Sunday, October 9 (11:59pm)


Project Description

You must design and implement a language for animating graphic objects on a canvas. Graphic objects can move smoothly or jump around the canvas, optionally stopping when a graphic object bumps into something (like an edge of the canvas or another graphic object). Graphic objects can also be added or removed during an animation. Here are three sample animations:

sample animations

For this project, you will develop:

  1. A language for specifying animations such as these.

  2. A program (interpreter) that will run an animation written in your language, displaying it on the screen.

You will do the project in two stages: a language design stage, followed by an implementation stage. Each stage has a separate due date.

Project Goal

The goal of the project is to make sure each student can define, design, and implement a domain-specific programming language.

This is an individual project -- you may not work with your homework partner, or any other students, on this project (see the collaboration policy for more details).


The Design Phase: DUE Monday, September 26, 11:59pm

For this phase, you will propose data definitions for an animation language. At a minimum, your animation language must meet the following requirements:

Hints and Guidelines

What to Turn in

Submit both the proposed language and examples showing how to represent all three sample animations above, plus one more animation of your own choosing, in your language.

You do not need to be able to run animation programs at the end of this stage. But you should be able to click 'Run' in DrRacket to execute your data definitions and examples without error!

A nice syntax (i.e., using macros) for the language is NOT needed at this stage either (you will add this in the implementation phase). All you need to submit are the data definitions and examples of data that you need to capture animation programs.

Like Homework 4, your submission at this point should NOT include any function definitions (or templates) or lambdas.

Submit an electronic file design.rkt (under turnin name Project Design) containing your work for this phase.


The Implementation Phase: DUE Sunday, October 9, 11:59pm

For implementing your project, you will work in the Pretty Big language level. To enable this language level in DrRacket, select Choose Language from the Language menu in the top toolbar, and then select Other Languages and under Legacy Languages, select Pretty Big. Finally, press the Run button (top right corner) to make this change take effect.

You will also be using a modified version of the graphics package you used in Homework 2, in which big-bang has been removed. This modified version is called world-cs1102.rkt. Download it and save it in the same directory as your project file, and then include the following at the top of your project file:

(require "world-cs1102.rkt")

Here are the key graphics functions that you will need to use:

You may also find the following function in Pretty Big useful:

The main function in your implementation should be called run-animation. It takes an animation program in your language and executes it (displays the animation on the screen). Your animation should happen in one window over time---you are not trying to produce a sequence of still frames as shown in the samples.

Important: Although you are using the same low-level graphics package as Homework 2 (the fire plane game), the architecture of the program in this project is quite different. The goal of this project is to practice the command interpreter design pattern studied in class using the slideshow example. Each command execution here causes the next frame (scene) of the animation to be displayed. You are not writing a physics simulator. If this instruction confuses you, please come to office hours!

You may decide to change or enhance your original language design as you write your interpreter. That's fine (even expected---implementing helps you assess your design decisions). Your project report (see below) should describe and explain the reason for all changes you decided to make from your original design.

Test Cases

You are expected to provide test cases for all functions except for those that return either images, scenes or void. Also, since the check-expect technology we are using is really intended for functional part of your code, you do not need to write test cases to check the side effects in your code. However, if you define your helper functions well, you will be able to write functional test cases for all the important computations, with the side effects localized to only a few Racket functions. For example, code and provide test cases for the functional helper f.

By the way, don't just write the test cases after you are all done, because they are required! It will save you a lot of time overall to write and run test cases all the way along your incremental development (successive refinement) process.

Finally, because the Pretty Big language does not by default provide check-expect, you will need to do some extra setup for testing, as described here.

The Project Report

Please write up to one page of comments at the front of your file (using the Racket block comment characters #| and |#) answering the following questions:

  1. What must the TA do to run your program? Provide concrete instructions (such as "execute (run-animation animation1)"), including a list of the animations you defined as your test cases. The staff won't grade a program that they can't run.

  2. What is the status of your implementation? Explain which features/aspects work and which don't. If you didn't get the repeating blocks commands to work, for example, say so. This gives the staff guidelines on how to test your system.

  3. How have you changed your design since the version you submitted for the design deadline? Explain the changes and why you made them (i.e., I found I couldn't do X because of problem Y with my earlier definition). We're interested in seeing what doing the implementation taught you about the language design.

  4. What, if anything, do you think could be cleaner in your design or implementation? If you are satisfied with your design, say so. If you think certain aspects should really be easier to use, easier to write, etc, explain those aspects and what you'd like to see different. No danger of losing points for honesty here (you'll only lose points for problems that we can detect without reading your report) -- we just want to hear your assessment as we determine our own.

What to Turn in

  1. A file project.rkt containing your work for this phase. Include your project report (see above) as a block comment (using #| and |#) at the front of the file.

Submit these via turnin, under the name Project Final


Grading

In general, the design phase counts for 25% of your project grade, the implementation phase (including final language design) for 70%, and your project report for 5%.

Design Phase Grading

We will grade your language designs on a 4-grade scale (check+, check, check-, no credit). At this stage, we're looking to see whether you thought out the design phase well -- did you identify appropriate data and commands? Does your design adequately support the given examples? Does your work demonstrate that you know what data definitions for languages look like?

There's no single right answer for this part, and while we will make suggestions on your designs, we won't give you a single right answer to follow when doing your implementation. Part of the exercise is for you to have to work with, and perhaps revise, your initial language design when it comes time to implement your animation system. Grades in this phase are more about how well you cover the sample animations than your low-level design decisions (which we fully expect to change as you start to implement the project).

Implementation Phase Grading

In the implementation phase, we will be looking at your final language design and its implementation. More specifically:

Some General Notes on Grading


Collaboration Policy

This is an individual project. Collaboration is not permitted on this assignment (not even with your homework partner). The course staff are the only people you may approach for help with this project (but do come to us if you need help). You may not ask anyone outside of the course staff questions on any aspect of this project. This includes:

Violations of this policy follow the general course collaboration policy, and will likely result in an NR for the course.

Why this policy? Given the fairly open collaboration policy on homeworks, this assignment helps us assess how much each student understands of the course material. Since some students struggle in timed situations such as exams, the project gives you a more open-ended setting in which to demonstrate what you've understood of the course material.