This week's book giveaway is in the Java in General forum.
We're giving away four copies of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 and have ishori Sharan & Adam L Davis on-line!
See this thread for details.
Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Koch SnowFlake

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
lowercase baba
Posts: 13025
66
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 22586
122
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 22586
122
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is the thread I was talking about.
 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got it now..

Thanks guys
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic