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,33 @@
F pascal_upp(n)
V s = [[0] * n] * n
s[0] = [1] * n
L(i) 1 .< n
L(j) i .< n
s[i][j] = s[i - 1][j - 1] + s[i][j - 1]
R s
F pascal_low(n)
V upp = pascal_upp(n)
V s = [[0] * n] * n
L(x) 0 .< n
L(y) 0 .< n
s[y][x] = upp[x][y]
R s
F pascal_sym(n)
V s = [[1] * n] * n
L(i) 1 .< n
L(j) 1 .< n
s[i][j] = s[i - 1][j] + s[i][j - 1]
R s
F pp(mat)
print([mat.map(String).join(",\n ")])
-V n = 5
print(Upper:)
pp(pascal_upp(n))
print("\nLower:")
pp(pascal_low(n))
print("\nSymmetric:")
pp(pascal_sym(n))