Question: Dragon curves. Write a program to print the instructions for drawing the dragon curves of order 0 through 5. The instructions are strings of F,
Dragon curves. Write a program to print the instructions for drawing the dragon curves of order 0 through 5. The instructions are strings of F, L, and R characters, where F means “draw line while moving 1 unit forward,” L means “turn left,” and R means “turn right.” A dragon curve of order n is formed when you fold a strip of paper in half n times, then unfold to right angles. The key to solving this problem is to note that a curve of order n is a curve of order n-1 followed by an L followed by a curve of order n-1 traversed in reverse order, and then to figure out a similar description for the reverse curve.
17 F LL FLF 5 45 FLFLFRFLFLFRFRF Dragon curves of order 0, 1, 2, and 3 FLFLFRF
Step by Step Solution
3.54 Rating (154 Votes )
There are 3 Steps involved in it
To create a program that generates dragon curves we need to understand the pattern behind them As st... View full answer
Get step-by-step solutions from verified subject matter experts
