File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -2528,14 +2528,20 @@ return $this.Rotate((360 / $SideCount) * $remainder).Forward($remainder * $Size)
2528
2528
# Draws a T shape by pushing and popping
2529
2529
turtle rotate -90 forward 42 push rotate 90 forward 21 pop rotate -90 forward 21 show
2530
2530
#>
2531
- if ($this.'.Stack' -isnot [Collections.Stack]) { return }
2532
-
2533
- if ($this.'.Stack'.Count -eq 0) { return }
2531
+ param()
2534
2532
2533
+ # If the stack is not a stack, return ourself
2534
+ if ($this.'.Stack' -isnot [Collections.Stack]) { return $this }
2535
+ # If the stack is empty, return ourself
2536
+ if ($this.'.Stack'.Count -eq 0) { return $this }
2537
+ # Pop the stack
2535
2538
$popped = $this.'.Stack'.Pop()
2536
- $null = $this.PenUp().Goto($popped.Position.X, $popped.Position.Y).PenDown()
2537
- $this.Heading = $popped.Heading
2538
- return $this
2539
+
2540
+ $this. # Rotate by the differene in heading,
2541
+ Rotate($popped.Heading - $this.Heading).
2542
+ # then teleport to the popped location
2543
+ Teleport($popped.Position.X, $popped.Position.Y)
2544
+
2539
2545
</Script >
2540
2546
</ScriptMethod >
2541
2547
<ScriptMethod >
You can’t perform that action at this time.
0 commit comments