• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Koch SnowFlake

 
Richard Lung
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have a problems on doing the Koch SnowFlake.
I'm confuse with how to approach the recursion.
this is my current code

 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12102
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What EXACTLY is your question? posting 70 lines of code and saying "i'm not sure what to do" isn't really very helpful. Does this code you posted compile? Does it run? Do you not understand what it does? Does it not do something you think it should?

reading your post, nobody has any idea what kind of help you need, and few folk are going to take the effort to help you figure it out. The more details, the more focused your question (heck, you didn't even ASK a question), the more likely you are to get the help you need.
 
Richard Lung
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry for not giving the detail problem.
so I want to create a snow flakes curves
something similar to this : http://www.owlnet.rice.edu/~comp212/06-spring/projects/kochCurve/koch.html
and I am having problem with approaching the recursion.
I am stuck, so I tried to set the level, whenever the level is, I would keep continue to making it as level 1.
I know that the problem is the recursion because I keep doing reduce the level until 1.
sorry if it's not clear it's difficult to explain exactly how. please see the sample if you don't mind
 
Rob Spoor
Sheriff
Pie
Posts: 20514
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This problem has come up before, and I remember writing a nice piece of code for it. That was a while ago though, so it may be hard to find.

I do remember you shouldn't go over 7 or 8 iterations because that will start to take multiple minutes just to render.
 
Rob Spoor
Sheriff
Pie
Posts: 20514
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the thread I was talking about.
 
Ulrika Tingle
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Richard Lung wrote:I'm confuse with how to approach the recursion.


Who said you needed to use recursion?

Try something else first. Then maybe recursion will seem more like a natural choise and then you'll know how to do it.
 
Richard Lung
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got it now..

Thanks guys
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic