This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Need help to create the Sierpiński Carpet using recursion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Need help to create the Sierpiński Carpet using recursion" Watch "Need help to create the Sierpiński Carpet using recursion" New topic
Author

Need help to create the Sierpiński Carpet using recursion

Krupa Patel
Greenhorn

Joined: Apr 18, 2012
Posts: 10
I am trying to create the Sierpinski Carpet using recursion. I divided the square into nine equal squares in the three rows and three columns.
And the center sub-square is removed.
I do not know how to repeat that process for the eight remaining sub-squares which surround the center square that was “removed.”
This is my code:

Please help me.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37874
    
  22
Don’t know. But I do know you can’t work it out in code. You have to work it out on paper. What is the algorithm?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help to create the Sierpiński Carpet using recursion
 
Similar Threads
Question about drawimage
i want to draw an equilateral sierpinski triangle.
Help with drawing random shapes based on JComboBox
AffineTransform "transform" method
[newbie] The type MouseComponent must implement the inherited abstract method MouseMotionListener...