KochCurve code
import gpdraw.*; public class KochCurve { private DrawingTool marker; private SketchPad poster; public KochCurve(){ poster = new SketchPad(600,600); marker = new DrawingTool(poster); } public void drawKochCurve(int x, int y){ if (x < 1){ marker.forward(y); } else{ drawKochCurve(x - 1, y / 3); marker.turnLeft(60); drawKochCurve(x - 1, y / 3); marker.turnRight(120); drawKochCurve(x - 1, y / 3); marker.turnLeft(60); drawKochCurve(x - 1, y / 3); } } public void drawSnowflake(int x , int y){ if (x < 1){ marker.forward(y); } else{ marker.turnRight(90); drawKochCurve(x,y); marker.turnRight(120); drawKochCurve(x,y);