Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
24
Task/Permutations/Phixmonti/permutations.phixmonti
Normal file
24
Task/Permutations/Phixmonti/permutations.phixmonti
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
include ..\Utilitys.pmt
|
||||
|
||||
def save
|
||||
over over chain ps> swap 0 put >ps
|
||||
enddef
|
||||
|
||||
def permute /# l l -- #/
|
||||
len 2 > if
|
||||
len for drop
|
||||
pop swap rot swap 1 put swap permute
|
||||
endfor
|
||||
else
|
||||
save rotate save rotate
|
||||
endif
|
||||
swap len if
|
||||
pop rot rot 0 put
|
||||
else
|
||||
drop drop
|
||||
endif
|
||||
enddef
|
||||
|
||||
( ) >ps
|
||||
( ) ( 1 2 3 4 ) permute
|
||||
ps> sort print
|
||||
Loading…
Add table
Add a link
Reference in a new issue