import java.awt.*; /* CS111 Fall 2000 Lab 2 Sept 18, 2000 Writing a Method Wendy Wellesley */ public class Checksboard extends BuggleWorld { // dude is a CheckerBuggle who invokes the method drawPattern 4 times in order to create a little checkerboard public void run () { CheckerBuggle dude = new CheckerBuggle(); dude.drawPattern(); dude.setColor(Color.blue); dude.drawPattern(); dude.setColor(Color.yellow); dude.drawPattern(); dude.setColor(Color.black); dude.drawPattern(); } } class CheckerBuggle extends Buggle { // draws one step pattern public void drawPattern () { this.brushUp(); this.forward(); this.brushDown(); this.forward(); this.brushUp(); this.left(); this.forward(); this.brushDown(); this.backward(); this.right(); this.brushUp(); this.forward(); this.brushDown(); this.forward(); this.left(); } }