File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1398,23 +1398,27 @@ $LeftTurnSteps
1398
1398
1399
1399
$stepNumber = 1
1400
1400
$majorStepCount = 0
1401
+ $totalTurn = 0
1401
1402
do {
1402
1403
$null = for ($stepNumber = 1; $stepNumber -le [Math]::Abs($StepCount); $stepNumber++) {
1403
1404
$null = $this.Forward($side * $stepNumber)
1404
1405
if ($LeftTurnSteps) {
1405
1406
if ($LeftTurnSteps -contains $stepNumber) {
1407
+ $totalTurn -= $angle
1406
1408
$this.Left($angle)
1407
1409
} else {
1410
+ $totalTurn += $angle
1408
1411
$this.Right($angle)
1409
1412
}
1410
1413
} else {
1414
+ $totalTurn += $angle
1411
1415
$this.Right($angle)
1412
1416
}
1413
1417
}
1414
1418
$majorStepCount++
1415
1419
} until (
1416
- (-not ([Math]::Round($this.Heading , 5) % 360 )) -or
1417
- $majorStepCount -gt $StepCount
1420
+ (-not ([Math]::Round($totalTurn , 5) % 360 )) -and
1421
+ $majorStepCount -le [Math]::Abs( $StepCount)
1418
1422
)
1419
1423
1420
1424
return $this
You can’t perform that action at this time.
0 commit comments