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,18 @@
F s_permutations(seq)
V items = [[Int]()]
L(j) seq
[[Int]] new_items
L(item) items
I L.index % 2
new_items [+]= (0..item.len).map(i -> @item[0 .< i] [+] [@j] [+] @item[i..])
E
new_items [+]= (item.len..0).step(-1).map(i -> @item[0 .< i] [+] [@j] [+] @item[i..])
items = new_items
R enumerate(items).map((i, item) -> (item, I i % 2 {-1} E 1))
L(n) (3, 4)
print(Permutations and sign of #. items.format(n))
L(perm, sgn) s_permutations(Array(0 .< n))
print(Perm: #. Sign: #2.format(perm, sgn))
print()