Skip to content

Commit bb9826e

Browse files
feat: Turtle.BinaryTree() ( Fixes #94 )
1 parent 15aa433 commit bb9826e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Types/Turtle/BinaryTree.ps1

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
param(
2+
[double]$Size = 20,
3+
[int]$Order = 4,
4+
[double]$Angle = 45
5+
)
6+
return $this.Rotate(-90).LSystem('0', [Ordered]@{
7+
'1' = '11'
8+
'0' = '1[0]0'
9+
}, $Order, [Ordered]@{
10+
'[01]' = { $this.Forward($Size) }
11+
'\[' = { $this.Rotate($Angle * -1).Push() }
12+
'\]' = { $this.Pop().Rotate($Angle) }
13+
})
14+

0 commit comments

Comments
 (0)