Skip to content

Commit c5b9bb1

Browse files
StartAutomatingStartAutomating
authored andcommitted
feat: Turtle.BoxFractal ( Fixes #37 )
1 parent cc3e08e commit c5b9bb1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Turtle.types.ps1xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,26 @@
1515
</PropertySet>
1616
</Members>
1717
</MemberSet>
18+
<ScriptMethod>
19+
<Name>BoxFractal</Name>
20+
<Script>
21+
22+
param(
23+
[double]$Size = 20,
24+
[int]$Order = 4,
25+
[double]$Angle = 90
26+
)
27+
return $this.L('F-F-F-F', [Ordered]@{
28+
F = 'F-F+F+F-F'
29+
}, $Order, [Ordered]@{
30+
'\+' = { $this.Rotate($Angle) }
31+
'-' = { $this.Rotate($Angle * -1) }
32+
'F' = { $this.Forward($Size) }
33+
})
34+
35+
36+
</Script>
37+
</ScriptMethod>
1838
<ScriptMethod>
1939
<Name>Clear</Name>
2040
<Script>

0 commit comments

Comments
 (0)