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)
25282528 # Draws a T shape by pushing and popping
25292529 turtle rotate -90 forward 42 push rotate 90 forward 21 pop rotate -90 forward 21 show
25302530#>
2531- if ($this.'.Stack' -isnot [Collections.Stack]) { return }
2532-
2533- if ($this.'.Stack'.Count -eq 0) { return }
2531+ param()
25342532
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
25352538$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+
25392545 </Script >
25402546 </ScriptMethod >
25412547 <ScriptMethod >
You can’t perform that action at this time.
0 commit comments