RosettaCodeData/Task/Floyds-triangle/BCPL/floyds-triangle.bcpl

22 lines
348 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
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)
$)