Skip to content

Commit e2ab331

Browse files
StartAutomatingStartAutomating
authored andcommitted
feat: Turtle.Jump() ( Fixes #50 )
1 parent d1c5bc8 commit e2ab331

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

Turtle.types.ps1xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,34 @@ return $this.LSystem('A', @{
122122

123123
</Script>
124124
</ScriptMethod>
125+
<ScriptMethod>
126+
<Name>Jump</Name>
127+
<Script>
128+
&lt;#
129+
.SYNOPSIS
130+
Jumps the turtle forward by a specified distance
131+
.DESCRIPTION
132+
Moves the turtle forward by the specified distance without drawing.
133+
134+
Turtles may not be known for their jumping abilities, but they may surprise you!
135+
.EXAMPLE
136+
$turtle.
137+
Clear().
138+
Rotate(45).
139+
Forward(10).
140+
Jump(20).
141+
Forward(10).
142+
Symbol.Save("$pwd/Jump.svg")
143+
#&gt;
144+
param(
145+
# The distance to jump forward
146+
[double]$Distance
147+
)
148+
149+
$this.PenUp().Forward($Distance).PenDown()
150+
151+
</Script>
152+
</ScriptMethod>
125153
<ScriptMethod>
126154
<Name>KochCurve</Name>
127155
<Script>

0 commit comments

Comments
 (0)