diff --git a/README.md b/README.md index ec12e1c2..0d5e6dbe 100644 --- a/README.md +++ b/README.md @@ -139,12 +139,12 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp - [util/every](https://openhome.cc/eGossip/OpenSCAD/lib3x-every.html) - [util/fibseq](https://openhome.cc/eGossip/OpenSCAD/lib3x-fibseq.html) - [util/flat](https://openhome.cc/eGossip/OpenSCAD/lib3x-flat.html) -- [util/has](https://openhome.cc/eGossip/OpenSCAD/lib2x-has.html) -- [util/lerp](https://openhome.cc/eGossip/OpenSCAD/lib2x-lerp.html) -- [util/parse_number](https://openhome.cc/eGossip/OpenSCAD/lib2x-parse_number.html) -- [util/rand](https://openhome.cc/eGossip/OpenSCAD/lib2x-rand.html) -- [util/reverse](https://openhome.cc/eGossip/OpenSCAD/lib2x-reverse.html) -- [util/slice](https://openhome.cc/eGossip/OpenSCAD/lib2x-slice.html) +- [util/has](https://openhome.cc/eGossip/OpenSCAD/lib3x-has.html) +- [util/lerp](https://openhome.cc/eGossip/OpenSCAD/lib3x-lerp.html) +- [util/parse_number](https://openhome.cc/eGossip/OpenSCAD/lib3x-parse_number.html) +- [util/rand](https://openhome.cc/eGossip/OpenSCAD/lib3x-rand.html) +- [util/reverse](https://openhome.cc/eGossip/OpenSCAD/lib3x-reverse.html) +- [util/slice](https://openhome.cc/eGossip/OpenSCAD/lib3x-slice.html) - [util/some](https://openhome.cc/eGossip/OpenSCAD/lib3x-some.html) - [util/sort](https://openhome.cc/eGossip/OpenSCAD/lib3x-sort.html) - [util/sub_str](https://openhome.cc/eGossip/OpenSCAD/lib2x-sub_str.html) diff --git a/docs/lib2x-has.md b/docs/lib3x-has.md similarity index 100% rename from docs/lib2x-has.md rename to docs/lib3x-has.md diff --git a/docs/lib2x-lerp.md b/docs/lib3x-lerp.md similarity index 100% rename from docs/lib2x-lerp.md rename to docs/lib3x-lerp.md diff --git a/docs/lib2x-parse_number.md b/docs/lib3x-parse_number.md similarity index 70% rename from docs/lib2x-parse_number.md rename to docs/lib3x-parse_number.md index 3b7aaaf5..4ee66065 100644 --- a/docs/lib2x-parse_number.md +++ b/docs/lib3x-parse_number.md @@ -12,5 +12,5 @@ Parses the string argument as an number. use ; - echo(parse_number("10") + 1); // ECHO: 11 - echo(parse_number("-1.1") + 1); // ECHO: -0.1 + assert((parse_number("10") + 1) == 11); + assert((parse_number("-1.1") + 1) == -0.1); diff --git a/docs/lib2x-rand.md b/docs/lib3x-rand.md similarity index 100% rename from docs/lib2x-rand.md rename to docs/lib3x-rand.md diff --git a/docs/lib2x-reverse.md b/docs/lib3x-reverse.md similarity index 75% rename from docs/lib2x-reverse.md rename to docs/lib3x-reverse.md index 40206f55..3d2fac9b 100644 --- a/docs/lib2x-reverse.md +++ b/docs/lib3x-reverse.md @@ -12,5 +12,5 @@ Reverse a list. use ; - echo(reverse([1, 2, 3])); // ECHO: [3, 2, 1] + assert(reverse([1, 2, 3]) == [3, 2, 1]); diff --git a/docs/lib2x-slice.md b/docs/lib3x-slice.md similarity index 71% rename from docs/lib2x-slice.md rename to docs/lib3x-slice.md index a73e42c3..b6458034 100644 --- a/docs/lib2x-slice.md +++ b/docs/lib3x-slice.md @@ -14,5 +14,5 @@ Returns a list selected from `begin` to `end`, or to the `end` of the list (`end use ; - echo(slice([for(c = "helloworld") c], 0, 5)); // ECHO: ["h", "e", "l", "l", "o"] - echo(slice([for(c = "helloworld") c], 5)); // ECHO: ["w", "o", "r", "l", "d"] + assert(slice([for(c = "helloworld") c], 0, 5) == ["h", "e", "l", "l", "o"]); + assert(slice([for(c = "helloworld") c], 5) == ["w", "o", "r", "l", "d"]); diff --git a/src/util/has.scad b/src/util/has.scad index 00781e23..c0326fda 100644 --- a/src/util/has.scad +++ b/src/util/has.scad @@ -4,7 +4,7 @@ * @copyright Justin Lin, 2020 * @license https://opensource.org/licenses/lgpl-3.0.html * -* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-has.html +* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-has.html * **/ diff --git a/src/util/lerp.scad b/src/util/lerp.scad index e1fe65be..4eb2127b 100644 --- a/src/util/lerp.scad +++ b/src/util/lerp.scad @@ -4,13 +4,10 @@ * @copyright Justin Lin, 2020 * @license https://opensource.org/licenses/lgpl-3.0.html * -* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-lerp.html +* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-lerp.html * **/ function lerp(v1, v2, amt) = - let( - v = v2 - v1, - leng = len(v1) - ) + let(v = v2 - v1, leng = len(v1)) [for(i = 0; i < leng; i = i + 1) v1[i] + v[i] * amt]; \ No newline at end of file diff --git a/src/util/parse_number.scad b/src/util/parse_number.scad index 868f8e76..beb45ae6 100644 --- a/src/util/parse_number.scad +++ b/src/util/parse_number.scad @@ -4,7 +4,7 @@ * @copyright Justin Lin, 2017 * @license https://opensource.org/licenses/lgpl-3.0.html * -* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-parse_number.html +* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-parse_number.html * **/ diff --git a/src/util/rand.scad b/src/util/rand.scad index 1b7286fe..f21b7656 100644 --- a/src/util/rand.scad +++ b/src/util/rand.scad @@ -4,7 +4,7 @@ * @copyright Justin Lin, 2019 * @license https://opensource.org/licenses/lgpl-3.0.html * -* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-rand.html +* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-rand.html * **/ diff --git a/src/util/reverse.scad b/src/util/reverse.scad index 1826ae51..e18be2e0 100644 --- a/src/util/reverse.scad +++ b/src/util/reverse.scad @@ -4,7 +4,7 @@ * @copyright Justin Lin, 2019 * @license https://opensource.org/licenses/lgpl-3.0.html * -* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-reverse.html +* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-reverse.html * **/ diff --git a/src/util/slice.scad b/src/util/slice.scad index dfbe749a..7a296ba9 100644 --- a/src/util/slice.scad +++ b/src/util/slice.scad @@ -4,7 +4,7 @@ * @copyright Justin Lin, 2019 * @license https://opensource.org/licenses/lgpl-3.0.html * -* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-slice.html +* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-slice.html * **/