I'm trying to generate a list in NetLogo that contains several different unique lists of numbers 0 through n. For example, I have this line of code
set mylists [[0 1 2] [0 2 1] [1 0 2] [1 2 0] [2 0 1] [2 1 0]]
that I wrote to make all possible unique combinations of 0 1 and 2 without any repetition of the numbers within the lists. I would like to be able to the same thing but with a larger n. Is there an example of how to do this, or some sort of pseudocode algorithm that anyone knows of that I could check out? Thanks!
If you don't mind a recursive solution, you could do this:
Edit: Updated syntax in response to comment.