Friday, September 12, 2008

Bet you're not jealous...

(((Look what I get to do before next week......gotta love java coding/programming...))
Homework 2 (Due Thursday, September 18):

Copy the project named puzzle from downloads\Homeworks directory on Lamont. Open the project and have a look. You will see five classes: Canvas, View, Door, Line and Puzzle.

The constructor and the methods of the Puzzle class are incomplete. The comments tell you what is missing. You do not need to add any fields to this class. You do not need to change any of the other classes in this project.

The puzzle project allows a user to walk around in a virtual 3x3 room and solve a puzzle.

The room has nine locations with the following (x, y) coordinates.

(0, 0) (1, 0) (2, 0)
(0, 1) (1, 1) (2, 1)
(0, 2) (1, 2) (2, 2)

The user starts at location (1, 2). Directly across the room from the user is a door. The door may be blocked by 0, 1, or 2 force fields. The frame of the door identifies which force field is currently blocking it: a red frame means that only the red force field is on, a yellow frame means that only the yellow force field is on, an orange frame means that both force fields are on, and a green frame means that both fields are off.

Depending where the user steps in the room one of the force fields will either turn on or off. The goal of the puzzle is to cross the room (i.e., reach position (1,0)) facing the door with both force fields off (i.e., a green frame).

Upload your finished project into a folder named Homework2 underneath your Homeworks folder on lamont. Print out your code and bring it to class on Thursday.

The following screen captures show the start position (green) followed by the effects of moving right (yellow), then forward (orange), then forward again (yellow), then left (orange), then backward (red), and finally backward again (orange).
















1 comments:

Cynthia Lyn said...

I've got to say, none of the code stuff makes sence to me . . .

Friday, September 12, 2008

Bet you're not jealous...

(((Look what I get to do before next week......gotta love java coding/programming...))
Homework 2 (Due Thursday, September 18):

Copy the project named puzzle from downloads\Homeworks directory on Lamont. Open the project and have a look. You will see five classes: Canvas, View, Door, Line and Puzzle.

The constructor and the methods of the Puzzle class are incomplete. The comments tell you what is missing. You do not need to add any fields to this class. You do not need to change any of the other classes in this project.

The puzzle project allows a user to walk around in a virtual 3x3 room and solve a puzzle.

The room has nine locations with the following (x, y) coordinates.

(0, 0) (1, 0) (2, 0)
(0, 1) (1, 1) (2, 1)
(0, 2) (1, 2) (2, 2)

The user starts at location (1, 2). Directly across the room from the user is a door. The door may be blocked by 0, 1, or 2 force fields. The frame of the door identifies which force field is currently blocking it: a red frame means that only the red force field is on, a yellow frame means that only the yellow force field is on, an orange frame means that both force fields are on, and a green frame means that both fields are off.

Depending where the user steps in the room one of the force fields will either turn on or off. The goal of the puzzle is to cross the room (i.e., reach position (1,0)) facing the door with both force fields off (i.e., a green frame).

Upload your finished project into a folder named Homework2 underneath your Homeworks folder on lamont. Print out your code and bring it to class on Thursday.

The following screen captures show the start position (green) followed by the effects of moving right (yellow), then forward (orange), then forward again (yellow), then left (orange), then backward (red), and finally backward again (orange).
















1 comments:

Cynthia Lyn said...

I've got to say, none of the code stuff makes sence to me . . .

 

Blog Template by YummyLolly.com - Header made with PS brushes by gvalkyrie.deviantart.com
Sponsored by Free Web Space