Skip to content

Commit 1b59ef7

Browse files
author
James Brundage
committed
feat: Turtle default display ( Fixes #24 )
2 parents d6a8b1b + 66c8634 commit 1b59ef7

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Turtle.types.ps1xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,25 @@ $x = $Distance * [math]::round([math]::cos($this.Heading * [Math]::PI / 180),15)
2424
$y = $Distance * [math]::round([math]::sin($this.Heading * [Math]::PI / 180),15)
2525
$this.Position = $x, $y
2626
$this.Steps += "l $x $y"
27+
return $this
28+
</Script>
29+
</ScriptMethod>
30+
<ScriptMethod>
31+
<Name>HilbertCurve</Name>
32+
<Script>
33+
param(
34+
[double]$Size = 10,
35+
[int]$Order = 5,
36+
[double]$Angle = 90
37+
)
38+
$this.L('A', @{
39+
A = '+BF-AFA-FB+'
40+
B = '-AF+BFB+FA-'
41+
}, $Order, @{
42+
'F' = { $this.Forward($Size) }
43+
'\+' = { $this.Rotate($Angle) }
44+
'\-' = { $this.Rotate($Angle * -1) }
45+
})
2746
return $this
2847
</Script>
2948
</ScriptMethod>

0 commit comments

Comments
 (0)