This is my notepad where i collect the useful snippets of OpenSCAD code that i use over and over. Some better curated than others, some formatted for clarity some for efficiency.
function shuffle(list,l=1)=
let(c=concat( [for(i=[1:len(list)-1])list[i]],[list[0]])) l>0?
shuffle(c,l-1)
:c ;