CS 224 Project 0 - Writing a Jack Application


Write a Jack application (to get acquainted with the language before we write our compiler!)


Write a hangman program in Jack.  A screenshot is given on p194 in nand2tetris text but I made a couple of choices to keep things simple.  First,  I hard coded a single word for the game.  Secondly, I printed out underscores for unguessed letters.

Use the JackCompiler and VMEmulator to compile and then execute your code.


I did my work on phoenix.  If you wish to do your work on another platform then it is up to you to work out any kinks in the process.
You may copy all the nand2tetris software on phoenix from ~jillz/cs224/nand2tetris.zip and extract this archive.  Within your working directory, make sure that you have the two files JackCompiler.bat and VMEmulator.bat. Both these files can be found in the nand2tetris tools directory. Create another directory in your working directory called Hangman.  Copy into the Hangman directory all the files contained in the tools/OS directory.  You will now create two files in the Hangman directory: Main.jack and Hangman.jack within which you will type your jack code for the project.

To compile your jack code, open a terminal window in your working directory (the one that contains the JackCompiler, VMEmulator, and the Hangman directory.  Now type the command: JackCompiler Hangman

If your code compiled without errors you will now have two files Hangman.vm and Main.vm.  Of course if you code has compile errors you will need to fix these first.

To execute your compiled code type the command:  VMEmulator

Hit the load button and load the entire Hangman directory.  Select no animation for the run and hit the run button.  Play your game of hangman.

Submission and Grading:

Zip your Hangman directory and submit the zip file in GoucherLearn. It will be graded on the ability of your program to correctly handle a single game of hangman with the hangman graphics.