@afre Thanks, afre. That seem to confirm that it is useful in some cases other than building strings with it.
In light of permutations thing, I have released two permutations commands rep_extract_permutation_order
, and rep_find_permutation_lexicographic_index
.
Here how they work, let’s use rep_find_permutations
and see what it yields:
$ +rep_find_permutations 5 echo {I(#-1,80)}
=> 3,1,2,0,4
The command rep_find_permutations creates all the 720 possible order, and they are all sorted in lexicographic order. The math parser access index 80, and the resulting output is what it yields.
As for the 5, well, that is the number of items variable.
Let’s try rep_extract_permutation_order
and see what it yields:
$ rep_extract_permutation_order 5,80 echo ${}
=> 3,1,2,0,4
The result are the same? Huh, so what’s the difference? The difference is that this command doesn’t generate all of the permutation, it goes straight into finding out what could be the order at index n. And I know there’s the question of what the 5 means. Well, that is the number of items.
Let’s try rep_find_permutation_lexicographic_index
and see what it yields. (To use this command, just reorder a list of integer starting from 0, and the number of integer is the number of items):
$ rep_find_permutation_lexicographic_index 3,1,2,0,4 echo ${}
=> 80
With the above note, this is self-explanatory. It finds which index contains the following order.
These new commands does not generate all of the combinations, so you can literally access billions of index.
This means in theory, you can use those commands to reorder images, and blend them multiple ways.
EDIT: I pushed Bit-Plane Shuffler
upgrade. This demonstrates the use of those commands. Preview still needs work, but I will get to that later. Regardless, it is accurate.
On Ordered Dithering:
I finally figured how to make it look nice:
Here’s the 1-bit version: