SlideShare a Scribd company logo
1 of 2
Download to read offline
I need help with task 6. I have absolutely no idea about how to start.
koch.fdl looks like this Fractal Description Language Many fractals can be generated from
descriptions in the Fractal Description Language (.fdl). This language describes a start state of a
fractal and a set of rules how to progress to larger depths. For example, to generate a Koch curve,
we start with the initial (depth 0) state F signifying a forward move, i.e., a straight line. The rule
for expanding to the next depth is given as a replacement rule. F->FLFRF LIF where L is a 60
degree turn to the left and R is a 120 degree turn to the right. That is, we replace a straight line by
a straight line, a left-turn, a straight line, a sharp right-turn, a straight line, a left-turn, and a
fourth and final straight line. Thus, the state for depth 1 is FL F R F L F. To get to depth 2, we
have to apply the rule again to all positions of the state where it is possible, i.e., we have to
replace each of the four F by FLFR F L F. The result Is F L F R F L F L F L F R F L F R F L F
R F L F L F L F R F L F where the new sections are underlined to aid your understanding. To get
to depth 3, we would have to replace each of the 16 Fs by the right side of the rule. For the sake
of brevity, I leave this exercise to you. Let us take a look at the file koch.fdl available from the
project section of the course home page. The first line give the start state, i.e., the state F for
depth 0. The second line give the only rule needed for the Koch curve, i.e., start F rule F -
>FLFRFLFto replace F by F LFRFL F. The third length 2 depth 5 cmd F fd cmd L lt 60 cmd R rt
120 line specifies the length of each segment, i.e each straight line will be 2 units long. The
fourth line specifies that states should be ex panded to depth 5 before drawing the frac tal.
Finally, the Lines 5 to 7 specify that F is a straight line, L is a 60 degree left-turn and R is a 120
degree right-turn.
Solution
By the way you did not mention wchich programming language to use:
However, every programming language follows the same logics, despite the difference in
syntaxeses.
As you know the rule is to replace each left by right side For the task 6 we have to implement a
method by that performes this action.
For your understanding:
A method takes an argument (Any value / type / arrays) and returns after calculations.
Here We need to implement sucha a method named apply. As given above...
apply("F" , ["F","L","F","R","F","L","F"] , ["F","R","F","R","F"])
Here you can clearly understand that the method takes three values/arguments The first just a
String "F", second and third String arrays ([] indicates array in programming ).
The method goes here:
Using java to write method:
// Before you use the method you must declare the method with their datatypes
// So the method returns String array Return type also mentioned as array type of string
public String[] apply(String leftLetter, String arrayRight[], String arrayStatus[])
{
//Here creating a new String array with the size of 50
// This means the array now can hold 50 string in it
// You can change it depends on the requirements
String[] arrayGenerated=new String[50];
// Using a variable to store string into new array at right indexes serially
int index=0;
// For loop to check weather we have any "F" in the sequence or not
for(int i=0;i

More Related Content

More from meejuhaszjasmynspe52

Hand geometry 1. Definition2. Importance3. Advantages and d.pdf
Hand geometry 1. Definition2. Importance3. Advantages and d.pdfHand geometry 1. Definition2. Importance3. Advantages and d.pdf
Hand geometry 1. Definition2. Importance3. Advantages and d.pdf
meejuhaszjasmynspe52
 
a) Briefly describe three key differences between the genomes of pro.pdf
a) Briefly describe three key differences between the genomes of pro.pdfa) Briefly describe three key differences between the genomes of pro.pdf
a) Briefly describe three key differences between the genomes of pro.pdf
meejuhaszjasmynspe52
 
A.horizontal shift 2 units to the left and vertical shift 5 units up.pdf
A.horizontal shift 2 units to the left and vertical shift 5 units up.pdfA.horizontal shift 2 units to the left and vertical shift 5 units up.pdf
A.horizontal shift 2 units to the left and vertical shift 5 units up.pdf
meejuhaszjasmynspe52
 
1. inside source IP address and port number 172.16.1.2020translat.pdf
1. inside source IP address and port number 172.16.1.2020translat.pdf1. inside source IP address and port number 172.16.1.2020translat.pdf
1. inside source IP address and port number 172.16.1.2020translat.pdf
meejuhaszjasmynspe52
 
1- An information security manager routinely monitored Web Surfing a.pdf
1- An information security manager routinely monitored Web Surfing a.pdf1- An information security manager routinely monitored Web Surfing a.pdf
1- An information security manager routinely monitored Web Surfing a.pdf
meejuhaszjasmynspe52
 
Can a single magnetic pole (either a north pole or a south pole) be i.pdf
Can a single magnetic pole (either a north pole or a south pole) be i.pdfCan a single magnetic pole (either a north pole or a south pole) be i.pdf
Can a single magnetic pole (either a north pole or a south pole) be i.pdf
meejuhaszjasmynspe52
 
What recent and past actions have Canada and the US taken to counter.pdf
What recent and past actions have Canada and the US taken to counter.pdfWhat recent and past actions have Canada and the US taken to counter.pdf
What recent and past actions have Canada and the US taken to counter.pdf
meejuhaszjasmynspe52
 

More from meejuhaszjasmynspe52 (20)

Homework hmwk 5 Score 0 of 1 pt Bookmatch 4-17 (bookstatic) Oli 3 .pdf
Homework hmwk 5 Score 0 of 1 pt Bookmatch 4-17 (bookstatic) Oli 3 .pdfHomework hmwk 5 Score 0 of 1 pt Bookmatch 4-17 (bookstatic) Oli 3 .pdf
Homework hmwk 5 Score 0 of 1 pt Bookmatch 4-17 (bookstatic) Oli 3 .pdf
 
Hand geometry 1. Definition2. Importance3. Advantages and d.pdf
Hand geometry 1. Definition2. Importance3. Advantages and d.pdfHand geometry 1. Definition2. Importance3. Advantages and d.pdf
Hand geometry 1. Definition2. Importance3. Advantages and d.pdf
 
Find the general solution of the given differential equation. Sol.pdf
Find the general solution of the given differential equation. Sol.pdfFind the general solution of the given differential equation. Sol.pdf
Find the general solution of the given differential equation. Sol.pdf
 
Disorders characterized by abnormal replication of cells that leads .pdf
Disorders characterized by abnormal replication of cells that leads .pdfDisorders characterized by abnormal replication of cells that leads .pdf
Disorders characterized by abnormal replication of cells that leads .pdf
 
Differentiate between functions and formulas. Provide two examples o.pdf
Differentiate between functions and formulas. Provide two examples o.pdfDifferentiate between functions and formulas. Provide two examples o.pdf
Differentiate between functions and formulas. Provide two examples o.pdf
 
Could someone please solve this assignment using matlabSolution.pdf
Could someone please solve this assignment using matlabSolution.pdfCould someone please solve this assignment using matlabSolution.pdf
Could someone please solve this assignment using matlabSolution.pdf
 
Consider the many protein functions. Identify the protein function by.pdf
Consider the many protein functions. Identify the protein function by.pdfConsider the many protein functions. Identify the protein function by.pdf
Consider the many protein functions. Identify the protein function by.pdf
 
a) Briefly describe three key differences between the genomes of pro.pdf
a) Briefly describe three key differences between the genomes of pro.pdfa) Briefly describe three key differences between the genomes of pro.pdf
a) Briefly describe three key differences between the genomes of pro.pdf
 
A.horizontal shift 2 units to the left and vertical shift 5 units up.pdf
A.horizontal shift 2 units to the left and vertical shift 5 units up.pdfA.horizontal shift 2 units to the left and vertical shift 5 units up.pdf
A.horizontal shift 2 units to the left and vertical shift 5 units up.pdf
 
1. inside source IP address and port number 172.16.1.2020translat.pdf
1. inside source IP address and port number 172.16.1.2020translat.pdf1. inside source IP address and port number 172.16.1.2020translat.pdf
1. inside source IP address and port number 172.16.1.2020translat.pdf
 
25. How many integers between 1 and 1400 are divisible by either 2 o.pdf
25. How many integers between 1 and 1400 are divisible by either 2 o.pdf25. How many integers between 1 and 1400 are divisible by either 2 o.pdf
25. How many integers between 1 and 1400 are divisible by either 2 o.pdf
 
6. Which of the following epithelia andor cell surface modifications.pdf
6. Which of the following epithelia andor cell surface modifications.pdf6. Which of the following epithelia andor cell surface modifications.pdf
6. Which of the following epithelia andor cell surface modifications.pdf
 
6,7,8,9,10,11,12 6. movement of a solvent (usually water) to regions.pdf
6,7,8,9,10,11,12 6. movement of a solvent (usually water) to regions.pdf6,7,8,9,10,11,12 6. movement of a solvent (usually water) to regions.pdf
6,7,8,9,10,11,12 6. movement of a solvent (usually water) to regions.pdf
 
1- An information security manager routinely monitored Web Surfing a.pdf
1- An information security manager routinely monitored Web Surfing a.pdf1- An information security manager routinely monitored Web Surfing a.pdf
1- An information security manager routinely monitored Web Surfing a.pdf
 
1.    Europeans view Americans as people similar in ideas and cultur.pdf
1.    Europeans view Americans as people similar in ideas and cultur.pdf1.    Europeans view Americans as people similar in ideas and cultur.pdf
1.    Europeans view Americans as people similar in ideas and cultur.pdf
 
(TRUE FALSE) The use of swap rates rather than treasury rates as a.pdf
(TRUE  FALSE) The use of swap rates rather than treasury rates as a.pdf(TRUE  FALSE) The use of swap rates rather than treasury rates as a.pdf
(TRUE FALSE) The use of swap rates rather than treasury rates as a.pdf
 
Can a single magnetic pole (either a north pole or a south pole) be i.pdf
Can a single magnetic pole (either a north pole or a south pole) be i.pdfCan a single magnetic pole (either a north pole or a south pole) be i.pdf
Can a single magnetic pole (either a north pole or a south pole) be i.pdf
 
Write a recursive function in java named fib that will accept one in.pdf
Write a recursive function in java named fib that will accept one in.pdfWrite a recursive function in java named fib that will accept one in.pdf
Write a recursive function in java named fib that will accept one in.pdf
 
Why are culture media sterilized before they are used Do you think .pdf
Why are culture media sterilized before they are used  Do you think .pdfWhy are culture media sterilized before they are used  Do you think .pdf
Why are culture media sterilized before they are used Do you think .pdf
 
What recent and past actions have Canada and the US taken to counter.pdf
What recent and past actions have Canada and the US taken to counter.pdfWhat recent and past actions have Canada and the US taken to counter.pdf
What recent and past actions have Canada and the US taken to counter.pdf
 

Recently uploaded

Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
EADTU
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MysoreMuleSoftMeetup
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 
Orientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdfOrientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdf
Elizabeth Walsh
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 

Recently uploaded (20)

Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of Play
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
Orientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdfOrientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdf
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 

I need help with task 6. I have absolutely no idea about how to star.pdf

  • 1. I need help with task 6. I have absolutely no idea about how to start. koch.fdl looks like this Fractal Description Language Many fractals can be generated from descriptions in the Fractal Description Language (.fdl). This language describes a start state of a fractal and a set of rules how to progress to larger depths. For example, to generate a Koch curve, we start with the initial (depth 0) state F signifying a forward move, i.e., a straight line. The rule for expanding to the next depth is given as a replacement rule. F->FLFRF LIF where L is a 60 degree turn to the left and R is a 120 degree turn to the right. That is, we replace a straight line by a straight line, a left-turn, a straight line, a sharp right-turn, a straight line, a left-turn, and a fourth and final straight line. Thus, the state for depth 1 is FL F R F L F. To get to depth 2, we have to apply the rule again to all positions of the state where it is possible, i.e., we have to replace each of the four F by FLFR F L F. The result Is F L F R F L F L F L F R F L F R F L F R F L F L F L F R F L F where the new sections are underlined to aid your understanding. To get to depth 3, we would have to replace each of the 16 Fs by the right side of the rule. For the sake of brevity, I leave this exercise to you. Let us take a look at the file koch.fdl available from the project section of the course home page. The first line give the start state, i.e., the state F for depth 0. The second line give the only rule needed for the Koch curve, i.e., start F rule F - >FLFRFLFto replace F by F LFRFL F. The third length 2 depth 5 cmd F fd cmd L lt 60 cmd R rt 120 line specifies the length of each segment, i.e each straight line will be 2 units long. The fourth line specifies that states should be ex panded to depth 5 before drawing the frac tal. Finally, the Lines 5 to 7 specify that F is a straight line, L is a 60 degree left-turn and R is a 120 degree right-turn. Solution By the way you did not mention wchich programming language to use: However, every programming language follows the same logics, despite the difference in syntaxeses. As you know the rule is to replace each left by right side For the task 6 we have to implement a method by that performes this action. For your understanding: A method takes an argument (Any value / type / arrays) and returns after calculations. Here We need to implement sucha a method named apply. As given above... apply("F" , ["F","L","F","R","F","L","F"] , ["F","R","F","R","F"]) Here you can clearly understand that the method takes three values/arguments The first just a String "F", second and third String arrays ([] indicates array in programming ).
  • 2. The method goes here: Using java to write method: // Before you use the method you must declare the method with their datatypes // So the method returns String array Return type also mentioned as array type of string public String[] apply(String leftLetter, String arrayRight[], String arrayStatus[]) { //Here creating a new String array with the size of 50 // This means the array now can hold 50 string in it // You can change it depends on the requirements String[] arrayGenerated=new String[50]; // Using a variable to store string into new array at right indexes serially int index=0; // For loop to check weather we have any "F" in the sequence or not for(int i=0;i