Etch-a-sketch



First Laboratory: Expressions, Statements, and Interactions

Etch-a-sketch is designed to teach students about expressions and statements in an interactive environment where behavior is not 100% deterministic. Students write "recipes" for the movement behavior of a dot in a window. When the dot moves, it leaves a line from the start point to the end point.

Running the Program

There are several ways to run the code in class. You should choose the one that your students are ready for. They are presented in an order that represents an increasing usage of the command line utilities and options.

1. a) Click Here

      (requires Java WebStart). If you want to put a link on your course 
      web site, you may use a link like this (subject to our terms of use 
      like all materials on the site): 

      <a href="http://www.cs101.org/psets/etchasketch/demo/etchasketch.jnlp">Click Here</a>

2. a) java -jar etchasketch.jar
   b) File > Expand Classpath > (choose jar/dir of package of student code.)   
   c) File > Load Behavior > (enter fully qualified Class name for student code)

3. a) java -cp etchasketch.jar etchasketch.EtchControl
   b) File > Expand Classpath > (choose jar/dir of package of student code.)
   c) File > Load Behavior > (enter fully qualified Class name for student code)


4. a) jar -xvf nodenet.jar
   b) java etchasketch.EtchControl
   c) File > Expand Classpath > (choose jar/dir of package of student code.)
   d) File > Load Behavior > (enter fully qualified Class name for student code)

Usage Notes

Screen Shots

Here are two typical recipes. The first is shown in the main control panel, and the second is shown in a standalone recipe window.

Etch-a-sketch control panel Recipe standalone view

The drawing produced by compiling and executing these two recipes is shown below.

Drawing based on shown recipes

This page is a part of Lynn Andrea Stein's Rethinking CS101 project, part of the Computers and Cognition Group at the Franklin W. Olin College of Engineering.
This material is based upon work supported by the National Science Foundation under Grant No. EIA-0196404. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation
Valid HTML 4.01!
Valid CSS!
cs101-webmaster@olin.edu
Last modified: Monday, December 5 2005 at 5:19 AM EST