Modul:Mergesort
Aus KGS-Wiki
Die Dokumentation für dieses Modul kann unter Modul:Mergesort/Doku erstellt werden
local p = {}
function p.render()
local a = math.random(99)
local b = math.random(99)
local c = math.random(99)
local d = math.random(99)
local e = math.random(99)
local f = math.random(99)
local g = math.random(99)
local h = math.random(99)
local content = 'graph TD\n'
content = content .. 'subgraph divide\n'
content = content .. 'a[' .. a .. ' ' .. b .. ' ' .. c .. ' ' .. d .. ' ' .. e .. ' ' .. f .. ' ' .. g .. ' ' .. h .. ']\n'
content = content .. 'a --> b[' .. a .. ' ' .. b .. ' ' .. c .. ' ' .. d .. '] & c[' .. e .. ' ' .. f .. ' ' .. g .. ' ' .. h .. ']\n'
content = content .. 'b --> d[' .. a .. ' ' .. b .. '] & e[' .. c .. ' ' .. d .. ']\n'
content = content .. 'c --> f[' .. e .. ' ' .. f .. '] & g[' .. g .. ' ' .. h .. ']\n'
content = content .. 'd --> h[' .. a .. '] & i[' .. b .. ']\n'
content = content .. 'e --> j[' .. c .. '] & k[' .. d .. ']\n'
content = content .. 'f --> l[' .. e .. '] & m[' .. f .. ']\n'
content = content .. 'g --> n[' .. g .. '] & o[' .. h .. ']\n'
content = content .. 'end\n'
--content = content .. 'subgraph conquer\n'
--h --> p["{{#af_join:{{#af_sort:{{#af_list:{{{1|94}}} | {{{2|73}}}}}}}| }}"]
--i --> p
--j --> q["{{#af_join:{{#af_sort:{{#af_list:{{{3|58}}} | {{{4|61}}}}}}}| }}"]
--k --> q
--l --> r["{{#af_join:{{#af_sort:{{#af_list:{{{5|22}}} | {{{6|20}}}}}}}| }}"]
--m --> r
--n --> s["{{#af_join:{{#af_sort:{{#af_list:{{{7|46}}} | {{{8|75}}}}}}}| }}"]
--o --> s
--p --> t["{{#af_join:{{#af_sort:{{#af_list:{{{3|58}}} | {{{4|61}}} | {{{2|73}}} | {{{1|94}}}}}}}| }}"]
--q --> t
--r --> u["{{#af_join:{{#af_sort:{{#af_list:{{{6|20}}} | {{{5|22}}} | {{{7|46}}} | {{{8|75}}}}}}}| }}"]
--s --> u
--t --> v["{{#af_join:{{#af_sort:{{#af_list:{{{6|20}}} | {{{5|22}}} | {{{7|46}}} | {{{3|58}}} | {{{4|61}}} | {{{2|73}}} | {{{8|75}}} | {{{1|94}}}}}}}| }}"]
--u --> v
--end
local graph = frame:extensionTag('mermaid', content, {})
return graph
end
return p