Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
-- This file: (find-angg "LUA/lowerdiag.lua")
--    http://angg.twu.net/LUA/lowerdiag.lua.html
--
-- Sample output:
-- 1
-- >=2
-- >=+-3
-- >=>=+-4
--   >=>=+-6
--   >=+->=+-8
--   >=+-+-+-+-10
--   >=>=>=>=+-+-12
--   >=+-+-+-+-+---14
--   >=+->=+->=+---+-16
--   >=>=+->=--+---+---18
--   >=+->=---->=--+---+-20
--     >=------+---+--->=+-9
--     >=------+---+-----+---15
--             >=--+----->=-->=5
--                 >=------------7

matrix = {}
nodes = {}
PPT  = function (T) print(mytostring_table(T, ",\n ")) end
PPMM = function () PPT(matrix) end
PPM  = function () print(table.concat(map(table.concat, matrix), "\n")) end
addlinetomatrix = function (name)
    local n = #matrix
    local line = {[n + 1] = name}
    for i=1,n do line[i] = "  " end
    matrix[n + 1] = line
  end
addnodetomatrix = function (n, name)
    while #matrix < n do addlinetomatrix("") end
    matrix[n][n] = name
  end
addnode = function (str)
    if not nodes[str] then
      -- table.insert(nodes, str)
      -- nodes[str] = #nodes
      addlinetomatrix(str)
      nodes[str] = #matrix
      -- addnodetomatrix(nodes[str], str)
    end
    return nodes[str]
  end
addh = { ["  "] = "--", ["| "] = "+-" }
addv = { ["  "] = "| ", ["--"] = "+-" }
addlinkxy = function (x, y, str)
    if x > y then return addlinkxy(y, x, str) end
    matrix[y][x] = str
    for xx=x+1,y-1 do matrix[y][xx] = addh[matrix[y][xx]] or matrix[y][xx] end
    for yy=x+1,y-1 do matrix[yy][x] = addv[matrix[yy][x]] or matrix[yy][x] end
  end
addlink = function (name1, name2, linkstr)
    addlinkxy(nodes[name1], nodes[name2], linkstr or ">=")
  end

addnodes = function (str) map(addnode, split(str)) end
tolast = function (str)
    spl = split(str)
    for i=1,#spl do addnode(spl[i]) end
    for i=1,#spl-1 do addlink(spl[i], spl[#spl]) end
  end
tofirst = function (str)
    spl = split(str)
    for i=1,#spl do addnode(spl[i]) end
    for i=2,#spl do addlink(spl[1], spl[i]) end
  end

--[[
-- Demo/test:

* (eepitch-lua51)
* (eepitch-kill)
* (eepitch-lua51)
ee_dofile "~/LUA/lowerdiag.lua"
matrix = {}
nodes = {}
-- tofirst "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"
-- addnodes "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"
tofirst "1 2 3 4"
tofirst "2 4 6 8 10 12 14 16 18 20"
tofirst "3 6 9 12 15 18"
tofirst "4 8 12 16 20"
tofirst "5 10 15 20"
tofirst "6 12 18"
tofirst "7 14"
tofirst "8 16"
tofirst "9 18"
tofirst "10 20"
PPMM()
PPM()
PP(nodes)


--]]


-- Local Variables:
-- coding:               raw-text-unix
-- ee-anchor-format:     "«%s»"
-- End: