Skip to content

Commit aaec26c

Browse files
StartAutomatingStartAutomating
authored andcommitted
feat: Turtle.js.polygon ( Fixes #319 )
Self referencing
1 parent 8a576bb commit aaec26c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Turtle.types.ps1xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8515,10 +8515,12 @@ param()
85158515
</NoteProperty>
85168516
<NoteProperty>
85178517
<Name>polygon.js</Name>
8518-
<Value>function polygon(size, sides = 6) {
8518+
<Value>function polygon(size = 42, sides = 6) {
8519+
let $this = this
85198520
for (let side = 0; side &lt; sides; side++) {
8520-
turtle.forward(size).rotate(360/sides)
8521+
$this = $this.forward(size).rotate(360/sides)
85218522
}
8523+
return $this
85228524
}</Value>
85238525
</NoteProperty>
85248526
<NoteProperty>

0 commit comments

Comments
 (0)