We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Turtle.BoardFractal
1 parent 4f35c45 commit f85fc51Copy full SHA for f85fc51
Types/Turtle/BoardFractal.ps1
@@ -0,0 +1,30 @@
1
+<#
2
+.SYNOPSIS
3
+ Draws a Board
4
+.DESCRIPTION
5
+ Draws a Board, using an L-System
6
+.LINK
7
+ https://paulbourke.net/fractals/lsys/
8
+.EXAMPLE
9
+ turtle BoardFractal 42 1
10
11
+ turtle BoardFractal 42 2
12
13
+ turtle BoardFractal 42 3
14
15
+ turtle BoardFractal 42 4
16
+#>
17
+param(
18
+# The size of each segment
19
+[double]$Size = 200,
20
+# The order of magnitude (the number of expansions)
21
+[int]$Order = 4,
22
+# The default angle.
23
+[double]$Angle = 90
24
+)
25
+return $this.LSystem('F+F+F+F', [Ordered]@{
26
+ F = 'FF+F+F+F+FF'
27
+}, $Order, [Ordered]@{
28
+ '\+' = { $this.Rotate($Angle) }
29
+ 'F' = { $this.Forward($Size) }
30
+})
0 commit comments