Skip to content

Commit a62013f

Browse files
StartAutomatingStartAutomating
authored andcommitted
feat: Turtle.Pentaplexity ( Fixes #146 )
1 parent 999ca38 commit a62013f

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

Turtle.types.ps1xml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,43 @@ return $this
11271127

11281128
</Script>
11291129
</ScriptMethod>
1130+
<ScriptMethod>
1131+
<Name>Pentaplexity</Name>
1132+
<Script>
1133+
&lt;#
1134+
.SYNOPSIS
1135+
Draws a Pentaplexity
1136+
.DESCRIPTION
1137+
Draws a Pentaplexity Fractal, using an L-System
1138+
.LINK
1139+
https://paulbourke.net/fractals/lsys/
1140+
.EXAMPLE
1141+
turtle Pentaplexity 42 1
1142+
.EXAMPLE
1143+
turtle Pentaplexity 42 2
1144+
.EXAMPLE
1145+
turtle Pentaplexity 42 3
1146+
.EXAMPLE
1147+
turtle Pentaplexity 42 4
1148+
#&gt;
1149+
param(
1150+
# The size of each segment
1151+
[double]$Size = 200,
1152+
# The order of magnitude (the number of expansions)
1153+
[int]$Order = 4,
1154+
# The default angle.
1155+
[double]$Angle = 36
1156+
)
1157+
return $this.LSystem('F++F++F++F++F', [Ordered]@{
1158+
F = 'F++F++F+++++F-F++F'
1159+
}, $Order, [Ordered]@{
1160+
'\+' = { $this.Rotate($Angle) }
1161+
'-' = { $this.Rotate($Angle*-1)}
1162+
'F' = { $this.Forward($Size) }
1163+
})
1164+
1165+
</Script>
1166+
</ScriptMethod>
11301167
<ScriptMethod>
11311168
<Name>PenUp</Name>
11321169
<Script>

0 commit comments

Comments
 (0)