Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
32
Task/Permutations/Quackery/permutations-1.quackery
Normal file
32
Task/Permutations/Quackery/permutations-1.quackery
Normal 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$
|
||||
8
Task/Permutations/Quackery/permutations-2.quackery
Normal file
8
Task/Permutations/Quackery/permutations-2.quackery
Normal 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 ]
|
||||
Loading…
Add table
Add a link
Reference in a new issue