Skip to content

Commit f62e32c

Browse files
StartAutomatingStartAutomating
authored andcommitted
feat: Turtle.BinaryTree() ( Fixes #94 )
1 parent bb9826e commit f62e32c

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
@@ -98,6 +98,26 @@ $Distance = 10
9898

9999
$this.Forward($Distance * -1)
100100

101+
</Script>
102+
</ScriptMethod>
103+
<ScriptMethod>
104+
<Name>BinaryTree</Name>
105+
<Script>
106+
param(
107+
[double]$Size = 20,
108+
[int]$Order = 4,
109+
[double]$Angle = 45
110+
)
111+
return $this.Rotate(-90).LSystem('0', [Ordered]@{
112+
'1' = '11'
113+
'0' = '1[0]0'
114+
}, $Order, [Ordered]@{
115+
'[01]' = { $this.Forward($Size) }
116+
'\[' = { $this.Rotate($Angle * -1).Push() }
117+
'\]' = { $this.Pop().Rotate($Angle) }
118+
})
119+
120+
101121
</Script>
102122
</ScriptMethod>
103123
<ScriptMethod>

0 commit comments

Comments
 (0)