Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
9
Task/Permutations/Ursala/permutations-1.ursala
Normal file
9
Task/Permutations/Ursala/permutations-1.ursala
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#import std
|
||||
|
||||
permutations =
|
||||
|
||||
~&itB^?a( # are both the input argument list and its tail non-empty?
|
||||
@ahPfatPRD *= refer ^C( # yes, recursively generate all permutations of the tail, and for each one
|
||||
~&a, # insert the head at the first position
|
||||
~&ar&& ~&arh2falrtPXPRD), # if the rest is non-empty, recursively insert at all subsequent positions
|
||||
~&aNC) # no, return the singleton list of the argument
|
||||
3
Task/Permutations/Ursala/permutations-2.ursala
Normal file
3
Task/Permutations/Ursala/permutations-2.ursala
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#cast %nLL
|
||||
|
||||
test = permutations <1,2,3>
|
||||
Loading…
Add table
Add a link
Reference in a new issue