import java.awt.*; public class BreakfastWorld extends BuggleWorld { Randomizer rand = new Randomizer(9); public void reset() { super.reset(); initializeWalls(); buildHouse(); if (rand.chances(0.35)) { addBagel(3,3); } else { addBagel(rand.intBetween(4,9),1); } } public void run () { Buggle becky = new Buggle(); // becky goes outside becky.forward(2); becky.left(); becky.forward(); becky.right(); becky.forward(); becky.right(); becky.forward(); becky.left(); // walks to the bagel becky.forward(2); // and chows down becky.pickUpBagel(); } public void buildHouse() { addHorizontalWall(0,2); addHorizontalWall(1,2); addHorizontalWall(2,2); addVerticalWall(3,0); } //------------------------------------------------------------------------------ // The following main method is needed to run the applet as an application public static void main (String[] args) { runAsApplication(new BreakfastWorld(), "BreakfastWorld"); } } // class BreakfastWorld