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 @@
def floydstriangle( n:Int ) = {
val s = (1 to n)
val t = s map {i => (s.take(i-1).sum) + 1}
(s zip t) foreach { n =>
var m = n._2;
for( i <- 0 until n._1 ) {
val w = (t.last + i).toString.length + 1 // Column width from last row
print(" " + m takeRight w )
m+=1
}
print("\n")
}
}
// Test
floydstriangle(5)
floydstriangle(14)