# Background. In the late 1960's the biologist and botani

Added on - 18 Sep 2019

1

Pages

393

Words

295

Views

0

Downloads

Trusted by +2 million users,

1000+ happy students everyday

1000+ happy students everyday

Showing pages 1 to 1 of 1 pages

BackgroundIn the late 1960's the biologist and botanist, Aristid Lindenmayer, createdL-systems(Links to anexternal site.)to describe and model plant growth.He published a book entitledThe AlgorithimicBeauty of Plants, that shows the use of these systems (see link to PDF in modules on Canvas).An L-system consists of an alphabet which is simply a String containing the characters used, a initial(or axiom) String consisting of characters from the alphabet, and then a collection of production rulesfor transforming one generation into another.On this exam, you will only be dealing with one particular L-system --Sierpinski's Arrowhead Curve.So in this case the alphabet consists of "AB+-".The initial generation is "A".The production rulesare (A → +B−A−B+), (B → −A+B+A−).This means that when nextGen is called with "A", the onlyrule that applies is the first production rule and so a new String is created that contains only"+B−A−B+".If nextGen were called on that, the process is the same -- namely for each characterwe look at the production rules to see if one applies and then replace that in the result string with theproduction.So here is a full look at nextGen for"+B−A−B+":CharacterProductionruleResult so far+none+BB → −A+B+A−+−A+B+A−-none+−A+B+A−-AA → +B−A−B++−A+B+A−-+B−A−B+-none+−A+B+A−-+B−A−B+-BB → −A+B+A−+−A+B+A−-+B−A−B+-−A+B+A−+none+−A+B+A−-+B−A−B+-−A+B+A−+So the result of nextGen("+B−A−B+") is "+−A+B+A−-+B−A−B+-−A+B+A−+".Given a String that represents a generation, you can use an AnimatedTurtle to draw that String byfollowing the rules that A and B mean move forward and + means turn left 60 degrees and - meansturn right 60 degrees.RequirementsDownload, unzip, and open the starter project in IntelliJ.You must fill in the methods in theArrowheadCurve.java file.Your program must not use recursion.You must implement each of the methods in ArrowheadCurve.java that have TODOcomments.What to SubmitSubmit only your ArrowheadCurve.java file.

**You’re reading a preview**

To View Complete Document

Click the button to download

Subscribe to our plans