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,16 @@
import std.stdio, std.conv;
void floydTriangle(in uint n) {
immutable lowerLeftCorner = n * (n - 1) / 2 + 1;
foreach (r; 0 .. n)
foreach (c; 0 .. r + 1)
writef("%*d%c",
text(lowerLeftCorner + c).length,
r * (r + 1) / 2 + c + 1,
c == r ? '\n' : ' ');
}
void main() {
floydTriangle(5);
floydTriangle(14);
}