From ef39795f33293368879af91aebafdaa817326703 Mon Sep 17 00:00:00 2001 From: Jake Bolton Date: Sat, 1 Nov 2025 07:35:09 -0500 Subject: [PATCH 1/4] fix: `Turtle.js.teleport` ( re: #334 ) --- Types/Turtle.js/teleport.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Types/Turtle.js/teleport.js b/Types/Turtle.js/teleport.js index 703b335..73a821c 100644 --- a/Types/Turtle.js/teleport.js +++ b/Types/Turtle.js/teleport.js @@ -1,7 +1,7 @@ function teleport(x,y) { var penState = this.penDown this.penDown = false - step(x - this.x, y - this.y) + this.step(x - this.x, y - this.y) this.penDown = penState return this } \ No newline at end of file From 5e613b27130beb57b98aad0f98a3ee2e39f98bcf Mon Sep 17 00:00:00 2001 From: Jake Bolton Date: Sat, 1 Nov 2025 08:52:33 -0500 Subject: [PATCH 2/4] fix: `Turtle.js.get/set_heading` returned `NaN` ( fixes: #334, fixes: #336, fixes: #337, fixes: #338 ) --- Types/Turtle.js/get_heading.js | 1 - Types/Turtle.js/heading.js | 7 +++++++ Types/Turtle.js/set_heading.js | 4 +--- 3 files changed, 8 insertions(+), 4 deletions(-) delete mode 100644 Types/Turtle.js/get_heading.js create mode 100644 Types/Turtle.js/heading.js diff --git a/Types/Turtle.js/get_heading.js b/Types/Turtle.js/get_heading.js deleted file mode 100644 index 776f648..0000000 --- a/Types/Turtle.js/get_heading.js +++ /dev/null @@ -1 +0,0 @@ -heading: 0.0 \ No newline at end of file diff --git a/Types/Turtle.js/heading.js b/Types/Turtle.js/heading.js new file mode 100644 index 0000000..bf11f24 --- /dev/null +++ b/Types/Turtle.js/heading.js @@ -0,0 +1,7 @@ +function get_heading() { + const _ = this + if ( _['#heading'] === undefined ) { + _['#heading'] = 0.0 + } + return _['#heading'] +} diff --git a/Types/Turtle.js/set_heading.js b/Types/Turtle.js/set_heading.js index 020740d..12a2bcd 100644 --- a/Types/Turtle.js/set_heading.js +++ b/Types/Turtle.js/set_heading.js @@ -1,11 +1,9 @@ function set_heading(value) { - let _ = this + const _ = this try { _['#heading'] = new Number(value) } catch { - _['#heading'] = 0.0 } - return _ } \ No newline at end of file From fe67580b18acfd99ac9135cc1846417964207c82 Mon Sep 17 00:00:00 2001 From: Jake Bolton Date: Sat, 1 Nov 2025 08:54:50 -0500 Subject: [PATCH 3/4] fix: `Turtle.js.pathData` is not a function ( fixes: #339 ) --- Types/Turtle.js/pathData.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Types/Turtle.js/pathData.js b/Types/Turtle.js/pathData.js index 8133b6c..ce5b349 100644 --- a/Types/Turtle.js/pathData.js +++ b/Types/Turtle.js/pathData.js @@ -1,4 +1,4 @@ -function get_pathData() { +function pathData() { let startX = 0; let startY = 0; if (!this.min) { this.min = { x: 0.0, y: 0.0}} From bab43ec433c2b4532aafd14f9d8b7afee2d1e671 Mon Sep 17 00:00:00 2001 From: ninmonkey Date: Sat, 1 Nov 2025 13:58:15 +0000 Subject: [PATCH 4/4] fix: `Turtle.js.pathData` is not a function ( fixes: #339 ) --- Turtle.types.ps1xml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Turtle.types.ps1xml b/Turtle.types.ps1xml index 6178096..2633e59 100644 --- a/Turtle.types.ps1xml +++ b/Turtle.types.ps1xml @@ -8429,10 +8429,6 @@ foreach ($javaScriptProperty in $this.psobject.properties | Sort-Object Name) { ) } - - get_heading.js - heading: 0.0 - go.js function go() { @@ -8447,6 +8443,17 @@ foreach ($javaScriptProperty in $this.psobject.properties | Sort-Object Name) { goto.js function goto(x,y) { return this.step(x - this.x, y - this.y) } + + heading.js + function get_heading() { + const _ = this + if ( _['#heading'] === undefined ) { + _['#heading'] = 0.0 + } + return _['#heading'] +} + + height.js height: 0.0 @@ -8520,7 +8527,7 @@ foreach ($javaScriptProperty in $this.psobject.properties | Sort-Object Name) { pathData.js - function get_pathData() { + function pathData() { let startX = 0; let startY = 0; if (!this.min) { this.min = { x: 0.0, y: 0.0}} @@ -8579,14 +8586,12 @@ foreach ($javaScriptProperty in $this.psobject.properties | Sort-Object Name) { set_heading.js function set_heading(value) { - let _ = this + const _ = this try { _['#heading'] = new Number(value) } catch { - _['#heading'] = 0.0 } - return _ } @@ -8610,7 +8615,7 @@ foreach ($javaScriptProperty in $this.psobject.properties | Sort-Object Name) { function teleport(x,y) { var penState = this.penDown this.penDown = false - step(x - this.x, y - this.y) + this.step(x - this.x, y - this.y) this.penDown = penState return this }