Java AP Computer Science ~ Grid World Java

To set up Grid World on your computer, do the following steps:

1.Download zip file with Java code for Grid World, and unzip the file into your H:/drive or flash drive. You will need at least 8mb of free space.

2. Start up JCreator, go to File ---> New --> Project ---> Empty Project.


3. In JCreator's Project Settings, make sure the JDK Profiles is pointing to C:\Program Files\Java\jdk1.6.0_02\


4 Next, set up the jar file for Grid World by following these steps:
----> A. In JCreator's Project Settings, go to Required Libraries tab, and click "New" button.

-----> B. In the Set Library window, under the Classes tab, click the "Add" button, and select "Add Archive" button. Find the Grid World Code folder where you unzipped the code file. It should contain a file called gridworld.jar, which you will select and click the "Open" button.

-----> C. Upon returning to the Set Library window, enter GridWorldJar in the name field and press the OK button
.
-----> D. Upon returning to the Project Settings window, ensure you see the GridWorldJar in the Required Libraries tab, and that it is checked.

5. Next, in the Project menu, select the Add files... menu option.
-----> A. Iin the GridWorld folder, select the Projects subfolder, then the FirstProject subfolder.
-----> B. Click on BugRunner.java and press the "open" button. A dialog box will appear, asking if you would like to add the file to the project. Select the "add" button to go ahead and place BugRunner.java in your new project in JCreator.

6. Double-click the BugRunner.java file within the project, and view the code in the editor. Notice the import statements. No other classes are found in the project folder, since they are all found in the GridWorld jar file.

7. Under the Build menu in JCreator, select Compile Project, and once the "Process completed" message is returned, select Execute Project in the Build menu.

8. The Grid World bug should appear on a 10 x 10 grid. Click the "Step" button and observe the behavior of the bug. Now you are ready to begin answering the questions provided by the College Board for the AP Computer Science Case Study.

9. Note:
Steps 1 - 7 will be followed again when you are ready to compile and run the other 2 projects located in the following folders:

A. Code Zip File\GridWorldCode\GridWorldCode\projects\boxBug
BoxBug.java and BoxBugRunner.java

B. Code Zip File\GridWorldCode\GridWorldCode\projects\critters
ChameleonCritter.java, ChameleonRunner.java, CrabCritter.java, CritterRunner.java, and CrabRunner.java





 






AP Computer Science Study Guides from the College Board:

1. Part 1 - Studying the BugRunner.java

2. Part 2 - Studying BoxBug.java and BoxBugRunner.java
(Extending the BugRunner class)

3. Part 3 - Studying the Location class and the Actor superclass;
Creating a Jumper subclass.

4. Part 4 - Studying the Critter subclass; Extending the Critter subclass into a ChameleonCritter and the CrabCritter subclasses.

5. Part 5 - Studying BoundedGrid and UnboundedGid classes.


Additional Resources from GridWorld Online Workshop
Copyright Barbara Cloud Wells and Chris Nevison, 2007

Notes, Exercises, Discussions:

1.
Generics Tutorial
(Helps in understanding Grid classes)

2. Othello Object Model

3. Additional Instructions, exercises, discussion forums for Units 1 - 6:

A. Unit 1 - Setting Up GridWorld

B. Unit 2 - Special Bugs

C. Unit 3 - Location and Grid

D. Unit 4 - Actor Class & the Classes that extend Actor

E. Unit 5 - Materials for Part 4 (Critters)

F. Unit 6 - Data Structures for Grid



Quizzes:
A. Quiz 1 - Bug Class, its behaviors/methods

B. Quiz 2 - BoxBug Class, and new types of bugs

C. Quiz 3 - Location Class and interaction w/Grid

D. Quiz 4 - Bounded & Unbounded Grids

E. Quiz 5 - Critter, ChameleonCritter, CribCritter, and CannibalCritter Classes

F. Quiz 6 -Big-O Notation for Bounded & Unbounded
Grids