Kochcurve code is not working?

Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
Reply

Join Date: Dec 2008
Posts: 2
Reputation: Nicoleoo is an unknown quantity at this point 
Solved Threads: 0
Nicoleoo Nicoleoo is offline Offline
Newbie Poster

Kochcurve code is not working?

 
0
  #1
Dec 2nd, 2008
I tried to run it, but nothing turned out. Can someone help?


import gpdraw.DrawingTool;
import gpdraw.SketchPad;

public class KochCurve {
private DrawingTool pen;
private SketchPad paper;

public KochCurve(){
paper = new SketchPad(500,500);
pen = new DrawingTool(paper);
}

public void draw(int level, int length) {

if (level < 1)
pen.forward(length);
else {
draw(level - 1, length / 3);
pen.turnLeft(60);
draw(level - 1, length / 3);
pen.turnRight(120);
draw(level - 1, length / 3);
pen.turnLeft(60);
draw(level - 1, length / 3);
}
}
}
-----------------------------Below is the driver
public class Driver {

public static void main(String[] args) {
KochCurve kc = new KochCurve();
kc.draw(6,300);
}
}
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 751
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Kochcurve code is not working?

 
0
  #2
Dec 2nd, 2008
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Computer Science Forum
Thread Tools Search this Thread



Tag cloud for Computer Science
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC