CS155b Homework 2

[You can't see this applet because your browser doesn't support Java, or Java isn't enabled.]

Here is the homework assignment. The list of Jscheme commands can be found here.

The Jscheme source of this applet is available here. You may be able to view the HTML source as well. As the operation of this applet isn't entirely trivial, following is a short description.

Use the directional buttons (NW, N, etc.) to draw lines in the corresponding direction in the Etch drawing window. To change the pen position without drawing a line, select Up from the Pen pop-up menu; select Down to draw again.

The line length adjustment buttons, labeled - and +, change the distance the pen moves each time a directional button is pushed. Values range from 1 to 99 pixels. The current distance, initially 10 pixels, is displayed between the - and + buttons.

To create a new Etch window, click the New Etch button. This action will replace the current drawing with a blank window. If you wish to save the displayed drawing, do so before clicking New Etch, otherwise the drawing will be lost.

Click Show Log to display a log of drawing actions. To save a drawing, copy the text from this window into your favorite text editor and save the file. To reload the drawing, click Load Etch..., specify the HTTP URL where the file is available*, and click Load or press return/enter. The log and drawing will be restored; you can add to the drawing if you wish. Unless you've modified the access restrictions on the Java 'sandbox' to allow network requests to servers other than that on which an applet is hosted, you can only specify URLs to drawing files on this server. Here are a few drawings to load:

* If you're using Mac OS Runtime for Java (MRJ) 2.0, the text field will initially be invisible. This is an artifact of Jscheme's interaction with MRJ; other Java text fields appear to display OK. It's possible to find the location of the text field by moving the pointer over the window until it becomes an I-beam, then selecting the existing text (http://, initially) and replacing it with the URL you wish to load. You can also try another Java VM, such as the MSIE/Metrowerks VM.

Nicholas Riley
Last modified: Sun Feb 8 22:06:01 EST 1998