RosettaCodeData/Task/Create-an-HTML-table/11l/create-an-html-table.11l

16 lines
559 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
UInt32 seed = 0
F nonrandom(n)
:seed = 1664525 * :seed + 1013904223
R Int(:seed >> 16) % n
F rand9999()
R nonrandom(9000) + 1000
F tag(tag, txt, attr = )
R <tagattr>txt</tag>
V header = tag(tr, ,X,Y,Z.split(,).map(txt -> tag(th, txt)).join())"\n"
V rows = (1..5).map(i -> tag(tr, tag(td, i, style="font-weight: bold;")(0.<3).map(j -> tag(td, rand9999())).join())).join("\n")
V table = tag(table, "\n"headerrows"\n")
print(table)