Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- t = {
- ["title"] =
- "a nice title on top of the restehheh",
- "a not as nice subtitle to fol",
- "this",
- "is",
- "some really really really long text",
- "more of it here",
- "would you care to read this ?",
- "this is some really really really long text"
- }
- tlen = string.len(t.title)
- len = 0
- for i = 1, table.maxn(t) do
- if string.len(t[i])>len then len = string.len(t[i]) end
- end
- print(" "..string.rep("_", math.min(tlen, 50)+2))
- print("|"..string.rep(" ", math.min(tlen, 50)+2).."|")
- a = "| "
- for i = 1, math.min(tlen, 50) do
- a = a..string.sub(t.title, i, i)
- end
- print(a..string.rep(" ", math.max(-string.len(a)+math.min(tlen, 50)+3, 0)).."|")
- print(
- "|"..string.rep("_", math.min(len, 50, tlen)+2)..
- string.sub("_|", (tlen-len)/math.abs(tlen-len), (tlen-len)/math.abs(tlen-len))..
- string.rep("_", math.min(50, math.max(len, tlen))-math.min(len, tlen)-1)..
- string.sub(" |", (len-tlen)/math.abs(len-tlen), (len-tlen)/math.abs(len-tlen))
- )
- print("|"..string.rep(" ", math.min(len, 50)+2).."|")
- for i = 1, table.maxn(t) do
- a = "| "
- for ii = 1, math.min(string.len(t[i]), 50) do
- a = a..string.sub(t[i], ii, ii)
- end
- print(a..string.rep(" ", math.max(-string.len(a)+math.min(len, 50)+3, 0)).."|")
- end
- print("|"..string.rep("_", math.min(len, 50)+2).."|")
- print("")
- ======================================
- ______________________________________
- | |
- | a nice title on top of the restehheh |
- |______________________________________|______
- | |
- | a not as nice subtitle to fol |
- | this |
- | is |
- | some really really really long text |
- | more of it here |
- | would you care to read this ? |
- | this is some really really really long text |
- |_____________________________________________|
Advertisement
Add Comment
Please, Sign In to add comment