Skip to content

Commit 7251b6b

Browse files
author
James Brundage
committed
feat: Turtle.js.step ( Fixes PoshWeb#308 )
1 parent 89a08b7 commit 7251b6b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Types/Turtle.js/step.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
function step(dx,dy) {
2+
if (this.isPenDown) { this.steps.push(` l ${dx} ${dy} `) }
3+
else { this.steps.push(` m ${dx} ${dy} `) }
4+
this.x += dx; this.y += dy ; this.resize()
5+
return this
6+
}
7+

0 commit comments

Comments
 (0)