Show Your Code #2

Pick one of the following problems to do to show your code.

1. Endless sidewalk (wrap around) - Generate 5 people, and have them randomly walk around. Write code that moves a person from one end of a row or column to the other if the person tries to walk off-screen. Use getWidth() and getHeight() to determine the size of the screen.

2. Making an entrance - Generate 5 people and 3 buildings. Have the people randomly walk around and detect whether or not a person has encountered a building. If so, enter the building (remove the Person from the board). I want you to do this in the Person instead of having the House remove the person.

3. Under construction - Generate 6 people and have them walk around randomly. Whenever two or more people enter the same location, a building is constructed there, provided one doesn't exist at that location.

4. Avoidance detection - Randomly generate 5 people and 5 buildings on the map. Have the people randomly move, but never into the same cell as buildings or other people.