Skip to content

Commit 1870a50

Browse files
authored
Update README.md assignment 3
1 parent 9576e71 commit 1870a50

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

assignment-3/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,62 @@ If the parameter -m is given, the program prints the result string as an output.
8787

8888
## Examples
8989
### 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
9097

9198
### 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:
113+
114+
python lsystem.py koch_island.json koch_island.txt
115+
And then to view it, use:
116+
117+
python mpl_draw.py koch_island.txt
92118

93119
### Example 3
120+
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
94127

95128
### 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)
96130

97131
### 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)
98133

99134
### 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.
100136

101137
### 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
102146

103147

104148
##

0 commit comments

Comments
 (0)