Recursive

Problem 1: Displaying Recursive Swirls
Review the solution to Programming Exercise 18.38 (Recursive tree) on Blackboard.
Then write a
program that will create recursive “swirls”. The user enters the order of the swirls and the number of
branches (straight lines) in each swirl. Swirls are recursively created at the end of each branch. The color
of each swirl is randomly chosen by the program.

You can accomplish this by having the paint method in your Pane class call a recursive
paintSwirl method:
paintSwirl(depth, getWidth() / 2, getHeight() / 2,
getHeight() / 4, Math.PI / 12);
The paintSwirl method that you

Leave a Reply

Your email address will not be published. Required fields are marked *