This project has intermediate milestones that are relevant to your grade.
Practice high level programming in the Jack language by building a simple game. Jack is a simple, modern, object-based programming language. In the next project we will build a compiler for it. Before we do so, it helps getting acquainted with the language by writing some programs in it.
Your goal is to adopt or invent an application idea like a simple computer game or some other interactive program. Then design and build the application.
You will need several tools: the Jack Compiler or the Jack IDE (win32 only), to translate your program into a set of .vm files, the VM Emulator, to run and test your program, and the Jack Operating System (OS). To help you get started, a sample Jack program is included in project 09.zip.
The executable Jack Operating System is a set of .vm
files that implement the standard library of the Jack programming language specified in Chapter 9. In order for any Jack program to execute properly, the compiled .vm
files of the program must reside in a directory that also contains all the .vm
files of the Jack OS. Here is a list of the Jack OS Error Codes and their textual meaning.
Description: This simple interactive program allows the user to move a square around the screen: The user can also change the square size during the movement.
|
When the program starts running, a square of size 30 by 30 pixels is placed at the top left corner of the screen. The program then listens, and responds to, the following keyboard keys:
Movement speed: to control it, you can change the delay constant in the moveSquare method in class SquareGame. |
Here is the source code of the Square Dance program (available in project 09.zip):
Class | Description |
Initializes and starts a new "square moving session." |
|
Implements an animated square. A square object has properties that characterizes its size and screen location, and methods for drawing, erasing, moving, and size changing. |
|
Runs the program according to the game rules. |
First, read ECS chapter 9. This pdf may also be insightful.
Within your src
directory, create a subdir named project09
. Extract the contents of project09.zip into it.
Add, commit and push the new files.
Next, compile and run the Square Dance 'game' by following the steps below.
Xxx
. Start by creating this directory, then copy all the files from tools/OS
into it.ClassName.jack
text file. Put all these .jack
files in the Xxx
directory.Xxx
). This will cause the compiler to translate all the .jack
classes found in the directory into corresponding .vm
files. If a compilation error is reported, debug the relevant class file and re-compile Xxx
until no error messages are issued.
Xxx
directory should contain three sets of files: your source .jack
files, the .vm
files that the compiler generated from them, and the .vm
files comprising the Jack OS. To test your program, load the entire Xxx
directory into the VM Emulator and then run the program. In case of run-time errors or undesired program behavior, fix the program and go back to step 2.Due Date | Points | Description | Grading Criteria |
---|---|---|---|
April 7 @ 4:00PM | 100 | Choose partners, declare program | You must send me an email that tells me:
|
April 9 @ 5:00PM | 100 | Initial version / Hello World in Jack | You must create, compile and run, and then commit & push the Main class for your program, whose main() method should just print "Hello World" or something ridiculous to the screen.This program should reside in project09/YourProgram/Main.jack . |
April 12 @ 3:00PM | 400 | Screen specification | You must commit & push a simple screen specification document (pdf preferred) that describes what your program will do. Examples will be presented in class, or you can refer to this simple example. |
April 16 @ 5PM | 400 | Final program | You must commit & push a complete, working version of your program. You should include a README unless your game is obvious to operate. |
Your repository must show a history of work. You should be committing at least every time you complete a milestone (per the ones above or your own intermediate milestones). A repository log showing one commit with a message like "project done" is not acceptable.