I have a list of 3 elements. I want to create range from each of them and iterate through all possible combinations.
What I need to re-write to be able operate with different amount of elements in initial list:
val el = List(5, 4, 7)
(0 to el(0)).map { e0 =>
(0 to el(1)).map { e1 =>
(0 to el(2)).map { e2 =>
doSmth(List(e1,e2,e0))
}}}
It should be simple task. Just curious how to google it...
doSmthtakes, meaning that you'd have to know how lowelis at compile-time too.