GridWorld

GridWorld

GridWorld is a computer program case study written in Java for use with the AP Computer Science program. [Horstmann, Cay. [http://www.horstmann.com/gridworld/ "GridWorld".] "horstmann.com". Accessed September 15, 2008.] It serves as an example of object-oriented programming (OOP) embedded in a more complicated design project than most students have worked with before. GridWorld is the successor to the Marine Biology Simulation Case Study, which was used from 2000-2007.

The GridWorld framework was designed and implemented by [http://horstmann.com Cay Horstmann] , based on the Marine Biology Simulation Case Study. The narrative was produced by Chris Nevison and Barbara Cloud Wells, Colgate University.

Actors

The GridWorld Case Study employs an Actor class to construct objects in the grid. The Actor class manages the object's color, direction, location, what the object does in the simulation, and how the object interacts with other objects.

Actors are broken down into the classes "Flower", "Rock", "Bug", and "Critter", which inherit the Actor class and often override certain methods (most notably the Act method). Flowers can't move, and when forced to Act, they become darker. Flowers are dropped by Bugs and eaten by Critters. Rocks are also immobile and aren't dropped or eaten. Bugs move directly ahead of themselves, unless blocked by a rock or another bug, in which case the Bug will make a 45 degree turn and try again. They drop flowers in every space they occupy, eat flowers that are directly on their space of grid, and are consumed by Critters. Critters move in a random direction to a space that isn't occupied by a Rock or other Critter and consume Flowers and Bugs.

Extensions

Students often create their own extensions of the Actor class. Some common examples of student created extensions are Warden organisms and SimCity-like structures, in which objects of certain types create objects of other types based on their neighbors (much like the game of Life).

References

External links

* [http://gridworld.info/ GridWorld.info] Unofficial GridWorld Site
* [http://apcentral.collegeboard.com/apc/public/courses/teachers_corner/4483.html College Board AP Computer Science Page]


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Advanced Placement Computer Science — This article is part of the Advanced Placement  series. General exam structure    •    Awards Current Subjects: Art History Biology Calculus (AB BC) Chemistry Chinese Language and Culture Comparative Government Politics… …   Wikipedia

  • AP Computer Science — Advanced Placement Computer Science (also called APCS) is the name of two distinct Advanced Placement courses and examinations offered by the College Board to high school students as an opportunity to earn college credit for a college level… …   Wikipedia

  • Marine Biology Simulation Case Study — The Marine Biology Simulation Case Study (MBCS) is a program written in Java for use with the Advanced Placement Computer Science A and AB examinations. It serves as an example of object oriented programming (OOP) embedded in a more complicated… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”