/* * AP(r) Computer Science GridWorld Case Study: * Copyright(c) 2005-2006 Cay S. Horstmann (http://horstmann.com) * * This code is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation. * * This code is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * @author Cay Horstmann * @author Chris Nevison * @author Barbara Wells */ import info.gridworld.actor.ActorWorld; import info.gridworld.actor.Rock; import info.gridworld.grid.Location; import java.awt.Color; /** * This class runs a world that contains box bugs. *
* This class is not tested on the AP CS A and AB exams. */ public class BirthdayRunner { public static void main(String[] args) { ActorWorld world = new ActorWorld(); for (int i = 1; i <= 8; i++) for (int j = 4; j <= 6; j++) world.add(new Location(j, i), new Rock()); for (int i = 1; i <= 8; i+= 2) world.add(new Location(3, i), new Candle()); world.show(); world.setMessage("Happy First Birthday, GridWorld!"); } }