mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
Add files via upload
This commit is contained in:
parent
593b46cb91
commit
e54f896a1a
1 changed files with 14 additions and 0 deletions
14
arrays.scad
14
arrays.scad
|
@ -186,6 +186,20 @@ function list_set(indices,values,list=[],dflt=0,minlen=0) =
|
|||
replist(dflt, minlen-lastind-1)
|
||||
);
|
||||
|
||||
// Function: list_increasing()
|
||||
// Usage:
|
||||
// list_increasing(list)
|
||||
// Description: returns true if the list is (non-strictly) increasing
|
||||
function list_increasing(list,ind=0) = ind < len(list)-1 && list[ind]<=list[ind+1] ? list_increasing(list,ind+1) :
|
||||
(ind>=len(list)-1 ? true : false);
|
||||
|
||||
|
||||
// Function: list_decreasing()
|
||||
// Usage:
|
||||
// list_increasing(list)
|
||||
// Description: returns true if the list is (non-strictly) decreasing
|
||||
function list_decreasing(list,ind=0) = ind < len(list)-1 && list[ind]>=list[ind+1] ? list_increasing(list,ind+1) :
|
||||
(ind>=len(list)-1 ? true : false);
|
||||
|
||||
|
||||
// Function: list_remove()
|
||||
|
|
Loading…
Reference in a new issue