We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1ee5bc5 commit 38fc5b3Copy full SHA for 38fc5b3
1 file changed
Types/Turtle/ClosePath.ps1
@@ -0,0 +1,19 @@
1
+<#
2
+.SYNOPSIS
3
+ Closes a path
4
+.DESCRIPTION
5
+ Closes a path and resets the position to the last move command (Start or Teleport)
6
+.EXAMPLE
7
+ turtle forward 42 rotate 90 forward 42 closePath rotate 90 forward 42 rotate 90 forward 42 closePath show
8
+#>
9
+param()
10
+$this.Steps.Add("z")
11
+$history =$this.History
12
+if ($history) {
13
+ $change = $this.History[-1]
14
+ $this.Position = $change.Delta.X, $change.Delta.Y
15
+} else {
16
+ $this.Position = 0, 0
17
+}
18
+
19
0 commit comments