Wednesday, September 26, 2001
Task 1 Draw JEM for the following example:
For exercises 2 and 3 please download the folder lab3
from the
download
directory on nike
.
Read about the Escher knitting patterns from the current Problem Set.
Recall that the two basic patterns are:
|
|
LabKnitWorld.java
file.
Task 2 Fill in the code for these methods to obtain the patterns. Consult Picture World contract if necessary.
|
|
|
|
First, a gentle introduction to quilting (Tasks 3a & 3b):
Task 3a Suppose you are given the following black box method:
public
Picture triangle (Color c)
Returns a Picture of a triangle of the specified Color whose vertices are at (0,0), (1,0), and (0,1).
For example,
|
Using only the methods in the PictureWorld contract, write (on paper) the expressions which will return the following Pictures:
|
|
|
Task 3b
Evaluate the following expressions. Draw (on paper) the
Picture
that each represents. Indicate the colors in
whatever way is convenient (colored pencils, markers,etc.). Do
not write a program to run on the computer to show you the
pictures; do it by hand!
picture 4
overlay(clockwise90(triangle(Color.blue)),triangle(Color.blue));
picture 5
above(fourSame(flipDiagonally(triangle(Color.yellow))), beside(triangle(Color.green), above(empty(), flipVertically(triangle(Color.green)))));
Task 3c
Read about QuiltWorld in
Problem Set 3.
Below are two simpler
quilt designs to figure out. The skeletons for the methods are in the
LabQuiltWorld.java
file.
To test your code, move the file LabQuiltWorld.html
to the topmost position in Link
Order in your project.
|
|