A Lindenmayer system (L-system) works by starting with an initial string, and applying replacement rules in parallelsay
Question:
A Lindenmayer system (L-system) works by starting with an initial string, and applying replacement rules in parallel—say by replacing all occurrences of F with FLFRRFLF. If the initial string is FRRFRRF, then after one iteration we obtain FLFRRFLFRRFLFRRFLFRRFLFRRFLF. Use these rules to develop a Turtle client to draw the Koch snowflake. Interpret F as meaning go one step forward with the pen down, L as turn counterclockwise 60 degrees, and R as turn clockwise 60 degrees. Then, the string after the nth iteration is an order n Koch snowflake. Compose a Java program Lindenmayer that takes a command-line argument n and prints the instructions for producing an order n Koch snowflake. Hint: Use the method String.replaceAll().
Calculus Early Transcendentals
ISBN: 978-0321947345
2nd edition
Authors: William L. Briggs, Lyle Cochran, Bernard Gillett