We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Turtle.Forward()
1 parent 93dafc2 commit 10076b6Copy full SHA for 10076b6
Types/Turtle/Forward.ps1
@@ -0,0 +1,9 @@
1
+param(
2
+[double]
3
+$Distance = 10
4
+)
5
+
6
+$x = $Distance * [math]::round([math]::cos($this.Heading * [Math]::PI / 180),15)
7
+$y = $Distance * [math]::round([math]::sin($this.Heading * [Math]::PI / 180),15)
8
+$this.Position = $x, $y
9
+$this.Steps += "l $x $y"
0 commit comments