We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Turtle.Step()
1 parent 6402e9e commit a1cb81bCopy full SHA for a1cb81b
1 file changed
Types/Turtle/Step.ps1
@@ -0,0 +1,26 @@
1
+<#
2
+.SYNOPSIS
3
+ Takes a Step
4
+.DESCRIPTION
5
+ Makes a relative movement.
6
+.EXAMPLE
7
+ turtle step 5 5 step 0 -5 step -5 0 save ./stepTriangle.svg
8
+#>
9
+param(
10
+# The DeltaX
11
+[double]$DeltaX = 0,
12
+# The DeltaY
13
+[double]$DeltaY = 0
14
+)
15
+
16
+# If both coordinates are empty, there is no step
17
+if ($DeltaX -or $DeltaY) {
18
+ $this.Position = $DeltaX, $DeltaY
19
+ if ($This.IsPenDown) {
20
+ $this.Steps += " l $DeltaX $DeltaY"
21
+ } else {
22
+ $this.Steps += " m $DeltaX $DeltaY"
23
+ }
24
+}
25
26
+return $this
0 commit comments