Factorial base numbers indexing permutations of a collection: Difference between revisions
Content deleted Content added
m →{{header|zkl}}: change example to show hit max base |
m →{{header|zkl}}: added some formatting |
||
Line 226: | Line 226: | ||
omega |
omega |
||
}</lang> |
}</lang> |
||
{{out|Part 1}} |
|||
<lang zkl>println("Part 1: Generate table:"); |
<lang zkl>println("Part 1: Generate table:"); |
||
foreach a,b,c in (4,3,2){ |
foreach a,b,c in (4,3,2){ |
||
Line 258: | Line 259: | ||
3.2.1 --> 3210 |
3.2.1 --> 3210 |
||
</pre> |
</pre> |
||
{{out|Part 3}} |
|||
<lang zkl>println("Part 3: Generate the given task shuffles:"); |
<lang zkl>println("Part 3: Generate the given task shuffles:"); |
||
deck:=List(); |
deck:=List(); |
||
Line 273: | Line 275: | ||
2♣5♣J♥4♥J♠A♠5♥A♣6♦Q♠9♣3♦Q♥J♣10♥K♣10♣5♦7♥10♦3♠8♥10♠7♠6♥5♠K♥4♦A♥4♣2♥9♦Q♣8♣7♦6♣3♥6♠7♣2♦J♦9♥A♦Q♦8♦4♠K♦K♠3♣2♠8♠9♠ |
2♣5♣J♥4♥J♠A♠5♥A♣6♦Q♠9♣3♦Q♥J♣10♥K♣10♣5♦7♥10♦3♠8♥10♠7♠6♥5♠K♥4♦A♥4♣2♥9♦Q♣8♣7♦6♣3♥6♠7♣2♦J♦9♥A♦Q♦8♦4♠K♦K♠3♣2♠8♠9♠ |
||
</pre> |
</pre> |
||
{{out|Part 4}} |
|||
<lang zkl>println("Part 4: Generate a random shuffle:"); |
<lang zkl>println("Part 4: Generate a random shuffle:"); |
||
r:=[52..2,-1].pump(List,(0).random); |
r:=[52..2,-1].pump(List,(0).random); |