Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,32 @@
[ stack ] is perms.min ( --> [ )
[ stack ] is perms.max ( --> [ )
forward is (perms)
[ over size
perms.min share > if
[ over temp take
swap nested join
temp put ]
over size
perms.max share < if
[ dup size times
[ 2dup i^ pluck
rot swap nested join
swap (perms) ] ]
2drop ] resolves (perms) ( [ [ --> )
[ perms.max put
1 - perms.min put
[] temp put
[] swap (perms)
temp take
perms.min release
perms.max release ] is perms ( [ a b --> [ )
[ dup size dup perms ] is permutations ( [ --> [ )
' [ 1 2 3 ] permutations echo cr
$ "quack" permutations 60 wrap$
$ "quack" 3 4 perms 46 wrap$

View file

@ -0,0 +1,8 @@
[ ' [ [ ] ] swap times
[ [] i rot witheach
[ dup size 1+ times
[ 2dup i^ stuff
dip rot nested join
unrot ] drop ] drop ] ] is perms ( n --> [ )
4 perms witheach [ echo cr ]