Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Pascals-triangle/Frink/pascals-triangle.frink
Normal file
15
Task/Pascals-triangle/Frink/pascals-triangle.frink
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
pascal[rows] :=
|
||||
{
|
||||
widest = length[toString[binomial[rows-1, (rows-1) div 2]]]
|
||||
|
||||
for row = 0 to rows-1
|
||||
{
|
||||
line = repeat[" ", round[(rows-row)* (widest+1)/2]]
|
||||
for col = 0 to row
|
||||
line = line + padRight[binomial[row, col], widest+1, " "]
|
||||
|
||||
println[line]
|
||||
}
|
||||
}
|
||||
|
||||
pascal[10]
|
||||
Loading…
Add table
Add a link
Reference in a new issue