aspose file tools*
The moose likes Java in General and the fly likes Koch SnowFlake Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Koch SnowFlake" Watch "Koch SnowFlake" New topic
Author

Koch SnowFlake

Richard Lung
Greenhorn

Joined: Dec 07, 2009
Posts: 3
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

Joined: Oct 02, 2003
Posts: 11480
    
  16

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.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Richard Lung
Greenhorn

Joined: Dec 07, 2009
Posts: 3
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

Joined: Oct 27, 2005
Posts: 19761
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19761
    
  20

Here is the thread I was talking about.
Ulrika Tingle
Ranch Hand

Joined: Nov 24, 2009
Posts: 92
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

Joined: Dec 07, 2009
Posts: 3
I got it now..

Thanks guys
 
Consider Paul's rocket mass heater.
 
subject: Koch SnowFlake