|
Spring Semester 2005
|
Create a folder on your desktop and copy the following files in it:
Now add two more files to the folder:
Finally copy this last program in your folder, and you're ready to start:
Once you have all these files in the folder you're ready to proceed.
SliderTest and run it.
One.java and run it.
Dance.java and run it.
If things run smoothly your last two programs will look something like this:
So here's your lab assignment for next time.
A201/A597 LAB ASSIGNMENT ONE
Write two programs. A. First write a program as described below.
In your program:
Penguin, and add it to the room in the 8th line and 3rd column.
(7, 2) given our the numbering convention.
(2, 2).
(2, 7).
(7, 7).
(2, 7).
(7, 2), passing through (2, 2).
In writing this program the following summary should help:
A Penguin:
Rink at a certain location (you have to
ask the rink for that, though)
Rink:
add
in that order, in the method add.
Note that x and y still keep the meaning that they
originally had:
x is the number of columns to the left, and
y is the number of lines above (to the top)
When we create the Rink, and when we add a Penguin to it, we
mention x first, and y next, almost
as we do in analytical geometry. However when we refer to the
table of cells that the Rink is, we can also denote the cells
in the array by printing (y, x), that is,
by specifying the line first, and the column next. The point
being that both notations are well-established, and we need
to be aware of them both.
You should now write the program with no problems.
And here's a picture of Wallace and Gromit from The Wrong Trousers to remind you of it, and for motivation.

The Aardman Penguin is pictured in disguise at the beginning of the assignment.
B. The second part of the assignment asks you to write a program that prints the following strange picture exactly as shown:
/--\
|\n|
/--+--+
' " "
/--+--+--+
' " " "
/--+--+--+--+
|\n|\n|\n|\n|
\--+--+--+--/
You need to show these programs to the AI next week, in lab.
You also need to be able to take questions on the programs.
You also need to be able to take questions on the topics covered in class during the first week.
Please practice the programs and concepts shown in class Tue and Thu.
They have been posted as Lecture Notes One and Two.
Thu Jan 13 08:16:57 EST 2005