mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-01 20:40:28 +02:00
add every
This commit is contained in:
@@ -12,4 +12,6 @@ New modules/functions
|
|||||||
|
|
||||||
- `angles_between`
|
- `angles_between`
|
||||||
- `spherical_coordinate`
|
- `spherical_coordinate`
|
||||||
|
- `util/every`
|
||||||
- `util/some`
|
- `util/some`
|
||||||
|
|
||||||
|
5
src/util/every.scad
Normal file
5
src/util/every.scad
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
function _every(lt, assert_func, leng, i = 0) =
|
||||||
|
i == leng ? true :
|
||||||
|
assert_func(lt[i]) ? _every(lt, assert_func, leng, i + 1) : false;
|
||||||
|
|
||||||
|
function every(lt, assert_func) = _every(lt, assert_func, len(lt));
|
Reference in New Issue
Block a user