September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -0,0 +1,19 @@
defmodule Table do
defp put_rows(n) do
Enum.map_join(1..n, fn i ->
"<tr align=right><th>#{i}</th>" <>
Enum.map_join(1..3, fn _ ->
"<td>#{:rand.uniform(2000)}</td>"
end) <> "</tr>\n"
end)
end
def create_table(n\\3) do
"<table border=1>\n" <>
"<th></th><th>X</th><th>Y</th><th>Z</th>\n" <>
put_rows(n) <>
"</table>"
end
end
IO.puts Table.create_table

View file

@ -0,0 +1,6 @@
<table border=1>
<th></th><th>X</th><th>Y</th><th>Z</th>
<tr align=right><th>1</th><td>1362</td><td>1289</td><td>357</td></tr>
<tr align=right><th>2</th><td>1161</td><td>1345</td><td>1176</td></tr>
<tr align=right><th>3</th><td>391</td><td>62</td><td>609</td></tr>
</table>