import java.awt.*; public class WallHuggerWorld extends RandomBagelWorld { //------------------------------------------------------------------------------ // The following main method is needed to run the applet as an application public static void main (String[] args) { runAsApplication(new WallHuggerWorld(), "WallHuggerWorld"); } //------------------------------------------------------------------------------ public void run () { WallHugger peterParker = new WallHugger(); peterParker.setPosition(new Location(8, 6)); peterParker.tick128(); // Perform followWall() 128 times: } } class WallHugger extends TickBuggle { public void followWall() { if (isOverBagel()) { pickUpBagel(); } else if (isFacingWall()) { left(); } else { forward(); } } public void tick() { followWall(); } }