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,20 @@
triangle = (array) -> for n in array
console.log "#{n} rows:"
printMe = 1
printed = 0
row = 1
to_print = ""
while row <= n
cols = Math.ceil(Math.log10(n * (n - 1) / 2 + printed + 2.0))
p = ("" + printMe).length
while p++ <= cols
to_print += ' '
to_print += printMe + ' '
if ++printed == row
console.log to_print
to_print = ""
row++
printed = 0
printMe++
triangle [5, 14]