@@ -188,6 +188,54 @@ function Get-Turtle {
188
188
$flowerPetals2,
189
189
$flowerPetals
190
190
)
191
+ . EXAMPLE
192
+ # We can create a Star with N points
193
+ turtle star 42 5
194
+
195
+ turtle star 42 6
196
+
197
+ turtle star 42 7
198
+
199
+ turtle star 42 8
200
+ . EXAMPLE
201
+ # Stars look spectacular when we rotate and repeat them
202
+ turtle @('star',42,5,'rotate',72 * 5)
203
+
204
+ turtle @('star',42,6,'rotate',60 * 6)
205
+
206
+ turtle @('star',42,7,'rotate',(360/7) * 7)
207
+
208
+ turtle @('star',42,8,'rotate',45 * 8)
209
+ . EXAMPLE
210
+ # When we do this, we call it a Star Flower
211
+ turtle StarFlower 42
212
+ . EXAMPLE
213
+ turtle StarFlower 42 45 8 8
214
+ . EXAMPLE
215
+ turtle StarFlower 42 45 8 8
216
+ . EXAMPLE
217
+ # StarFlowers look spectacular when morphed
218
+ turtle StarFlower 42 45 8 24 morph @(
219
+ turtle StarFlower 42 45 8 24
220
+ turtle StarFlower 42 15 8 24
221
+ turtle StarFlower 42 45 8 24
222
+ )
223
+ . EXAMPLE
224
+ # We can rotate the points we morph into.
225
+ turtle StarFlower 42 45 8 24 morph @(
226
+ turtle StarFlower 42 45 8 24
227
+ turtle rotate (Get-Random -Max 360) StarFlower 42 15 8 24
228
+ turtle StarFlower 42 45 8 24
229
+ )
230
+ . EXAMPLE
231
+ # We can mix the number of points in a star flower morph
232
+ #
233
+ # (as long as we're drawing the same number of points)
234
+ turtle StarFlower 42 12 5 30 morph @(
235
+ turtle StarFlower 42 12 5 30
236
+ turtle rotate (Get-Random -Max 360) StarFlower 42 14.4 6 25
237
+ turtle StarFlower 42 12 5 30
238
+ )
191
239
. EXAMPLE
192
240
# We can construct a 'scissor' by drawing two lines at an angle
193
241
turtle Scissor 42 60
0 commit comments