Skip to content

Commit 4f96920

Browse files
StartAutomatingStartAutomating
authored andcommitted
fix: Moore Fixes ( Fixes #370 )
1 parent 168a74e commit 4f96920

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

Turtle.types.ps1xml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2226,17 +2226,24 @@ return $this
22262226
.LINK
22272227
https://en.wikipedia.org/wiki/Moore_curve
22282228
.EXAMPLE
2229-
$turtle = New-Turtle
2230-
$turtle.MooreCurve().Pattern.Save("$pwd/MooreCurvePattern.svg")
2229+
turtle id moore1 moorecurve 42 1
2230+
.EXAMPLE
2231+
turtle id moore2 moorecurve 42 2
2232+
.EXAMPLE
2233+
turtle id moore3 moorecurve 42 3
2234+
.EXAMPLE
2235+
turtle id moore4 moorecurve 42 4
22312236
.EXAMPLE
22322237
Move-Turtle MooreCurve 15 5 |
22332238
Set-Turtle Stroke '#4488ff' |
22342239
Save-Turtle "./MooreCurve.svg"
22352240
#>
22362241
param(
2237-
[double]$Size = 10,
2238-
[int]$Order = 4,
2239-
[double]$Angle = 90
2242+
[double]$Size = $(
2243+
(Get-Random -Min 42 -Max 84) * (1,-1 |Get-Random)
2244+
),
2245+
[int]$Order = (2,3,4 | Get-Random),
2246+
[double]$Angle = 90
22402247
)
22412248

22422249

@@ -2246,9 +2253,9 @@ return $this.LSystem(
22462253
L = '-RF+LFL+FR-'
22472254
R = '+LF-RFR-FL+'
22482255
},
2249-
4,
2256+
$Order,
22502257
@{
2251-
F = { $this.Forward(10) }
2258+
F = { $this.Forward($Size) }
22522259
'\+' = { $this.Rotate(90) }
22532260
'-' = { $this.Rotate(-90) }
22542261
}

0 commit comments

Comments
 (0)