Skip to content

Commit 68df361

Browse files
feat: Lucky turtle and random defaults ( Fixes #363, Fixes #366 )
Making StepSpiral a little _less_ random
2 parents f5213f3 + 8efe11d commit 68df361

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

Turtle.types.ps1xml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4733,20 +4733,18 @@ return $this
47334733
#>
47344734
param(
47354735
# The DeltaX
4736-
[double]$DeltaX = $(Get-Random -Min 0 -Max 100.0),
4736+
[double]$DeltaX = $(Get-Random -Min -100.0 -Max 100.0),
47374737
# The DeltaY
4738-
[double]$DeltaY = $(Get-Random -Min 0 -Max 100.0)
4738+
[double]$DeltaY = $(Get-Random -Min -100.0 -Max 100.0)
47394739
)
47404740

4741-
# If both coordinates are empty, there is no step
4742-
if ($DeltaX -or $DeltaY) {
4743-
4744-
$this.Position = $DeltaX, $DeltaY
4745-
if ($This.IsPenDown) {
4746-
$this.Steps.Add(" t $deltaX $deltaY")
4747-
} else {
4748-
$this.Steps.Add(" m $DeltaX $DeltaY")
4749-
}
4741+
# If both coordinates are empty, we aren't going anywhere.
4742+
# But we _might_ want a point to exist.
4743+
$this.Position = $DeltaX, $DeltaY
4744+
if ($This.IsPenDown) {
4745+
$this.Steps.Add(" t $deltaX $deltaY")
4746+
} else {
4747+
$this.Steps.Add(" m $DeltaX $DeltaY")
47504748
}
47514749

47524750
return $this

0 commit comments

Comments
 (0)