Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Floyds-triangle/11l/floyds-triangle.11l
Normal file
14
Task/Floyds-triangle/11l/floyds-triangle.11l
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
F floyd(rowcount)
|
||||
V rows = [[1]]
|
||||
L rows.len < rowcount
|
||||
V n = rows.last.last + 1
|
||||
rows.append(Array(n .. n + rows.last.len))
|
||||
R rows
|
||||
|
||||
F pfloyd(rows)
|
||||
V colspace = rows.last.map(n -> String(n).len)
|
||||
L(row) rows
|
||||
print(zip(colspace, row).map2((space, n) -> String(n).rjust(space)).join(‘ ’))
|
||||
|
||||
pfloyd(floyd(5))
|
||||
pfloyd(floyd(14))
|
||||
Loading…
Add table
Add a link
Reference in a new issue