You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: assignment-3/README.md
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,18 +87,62 @@ If the parameter -m is given, the program prints the result string as an output.
87
87
88
88
## Examples
89
89
### Example 1
90
+
If the user uses the [koch_2.json](https://github.com/stef4k/Algorithms-and-data-structures-assignments/blob/main/assignment-3/input%20files/koch_2.json) file and runs the script the following way:
91
+
92
+
python lsystem.py -m koch_2.json
93
+
94
+
the output of the program should be exactly as follows:
95
+
96
+
F + F-F-F + F + F + F-F-F + F-F + F-F-F + F-F + F-F-F + F + F + F-F-F + F + F
90
97
91
98
### Example 2
99
+
If the user runs the script the following way, using the [koch_5.json](https://github.com/stef4k/Algorithms-and-data-structures-assignments/blob/main/assignment-3/input%20files/koch_5.json) file:
100
+
101
+
python lsystem.py koch_5.json koch_5.txt
102
+
103
+
the output of the program should be the koch_5.txt file, which describes the Koch curve with five iterations.
104
+
105
+
In order to view the image, run:
106
+
107
+
python mpl_draw.py koch_5.txt
108
+
To save it to a file, run:
109
+
110
+
python mpl_draw.py koch_5.txt koch_5.png
111
+
112
+
To create the island of Koch, use the file [koch_island.json](https://github.com/stef4k/Algorithms-and-data-structures-assignments/blob/main/assignment-3/input%20files/koch_island.json) to get the result koch_island.txt:
To create the dragon curve, use the [dragon.json](https://github.com/stef4k/Algorithms-and-data-structures-assignments/blob/main/assignment-3/input%20files/dragon.json) file:
121
+
122
+
python lsystem.py dragon.json dragon.txt
123
+
124
+
And then to view it, use:
125
+
126
+
python mpl_draw.py dragon.txt
94
127
95
128
### Example 4
129
+
For the two Sierpiński triangles use the files [sierpinski.json](https://github.com/stef4k/Algorithms-and-data-structures-assignments/blob/main/assignment-3/input%20files/sierpinski.json) and [sierpinski_triangle_arrowhead.json](https://github.com/stef4k/Algorithms-and-data-structures-assignments/blob/main/assignment-3/input%20files/sierpinski_triangle_arrowhead.json)
96
130
97
131
### Example 5
132
+
To create various plants use the following files [plant_1.json](https://github.com/stef4k/Algorithms-and-data-structures-assignments/blob/main/assignment-3/input%20files/plant_1.json), [plant_2.json](https://github.com/stef4k/Algorithms-and-data-structures-assignments/blob/main/assignment-3/input%20files/plant_2.json), [plant_3.json](https://github.com/stef4k/Algorithms-and-data-structures-assignments/blob/main/assignment-3/input%20files/plant_3.json), [plant_4.json](https://github.com/stef4k/Algorithms-and-data-structures-assignments/blob/main/assignment-3/input%20files/plant_4.json), [plant_5.json](https://github.com/stef4k/Algorithms-and-data-structures-assignments/blob/main/assignment-3/input%20files/plant_5.json), [plant_6.json](https://github.com/stef4k/Algorithms-and-data-structures-assignments/blob/main/assignment-3/input%20files/plant_6.json)
98
133
99
134
### Example 6
135
+
To create the Penrose mosaic use the [penrose.json](https://github.com/stef4k/Algorithms-and-data-structures-assignments/blob/main/assignment-3/input%20files/penrose.json) file.
100
136
101
137
### Example 7
138
+
If the user uses the [edge_rewriting_1.txt](https://github.com/stef4k/Algorithms-and-data-structures-assignments/blob/main/assignment-3/input%20files/edge_rewriting_1.txt) file and runs the script:
139
+
140
+
python lsystem.py -d edge_rewriting_1.txt
141
+
142
+
The output should be:
143
+
144
+
FF + G + G-F-F + G + GF-G-FFG + F-G-FF-G + FG + G + F-F-GG +
145
+
-FF + G + G-F-FG-F + GG + F + G-FGG + F + GF-F-G + G + F-F-GG
0 commit comments