Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
21
Task/Floyds-triangle/BCPL/floyds-triangle.bcpl
Normal file
21
Task/Floyds-triangle/BCPL/floyds-triangle.bcpl
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
get "libhdr"
|
||||
|
||||
let width(n) = n<10 -> 1, 1 + width(n/10)
|
||||
|
||||
let floyd(rows) be
|
||||
$( let maxno = rows * (rows+1)/2
|
||||
let num = 1
|
||||
for r = 1 to rows
|
||||
$( for c = 1 to r
|
||||
$( writed(num, 1 + width(maxno-rows+c))
|
||||
num := num + 1
|
||||
$)
|
||||
wrch('*N')
|
||||
$)
|
||||
$)
|
||||
|
||||
let start() be
|
||||
$( floyd(5)
|
||||
wrch('*N')
|
||||
floyd(14)
|
||||
$)
|
||||
Loading…
Add table
Add a link
Reference in a new issue