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
13981398
13991399$stepNumber = 1
14001400$majorStepCount = 0
1401+ $totalTurn = 0
14011402do {
14021403 $null = for ($stepNumber = 1; $stepNumber -le [Math]::Abs($StepCount); $stepNumber++) {
14031404 $null = $this.Forward($side * $stepNumber)
14041405 if ($LeftTurnSteps) {
14051406 if ($LeftTurnSteps -contains $stepNumber) {
1407+ $totalTurn -= $angle
14061408 $this.Left($angle)
14071409 } else {
1410+ $totalTurn += $angle
14081411 $this.Right($angle)
14091412 }
14101413 } else {
1414+ $totalTurn += $angle
14111415 $this.Right($angle)
14121416 }
14131417 }
14141418 $majorStepCount++
14151419} 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)
14181422)
14191423
14201424return $this
You can’t perform that action at this time.
0 commit comments