upload to git
This commit is contained in:
29
output_sizes.lua
Normal file
29
output_sizes.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
return function(tbl)
|
||||
local words_max_length = {1,1,1,1,1,1}
|
||||
|
||||
for i=1, #tbl do
|
||||
local this_word = tbl[i][2]
|
||||
for j=1, #this_word-1 do
|
||||
local length = string.len(this_word[j])
|
||||
if length + 1 > words_max_length[j+1] then
|
||||
words_max_length[j+1] = length + 1
|
||||
end
|
||||
end
|
||||
local length = string.len(convertToHeonian(this_word[1]))
|
||||
if length + 1 > words_max_length[1] then
|
||||
words_max_length[1] = length + 1
|
||||
end
|
||||
end
|
||||
|
||||
for i=1, #words do
|
||||
for j=1, #words[i]-1 do
|
||||
local times = words_max_length[j+1] - string.len(words[i][j])
|
||||
while times > 0 do
|
||||
words[i][j] = words[i][j] .. " "
|
||||
times = times - 1
|
||||
end
|
||||
words[i][j] = words[i][j] .. " "
|
||||
end
|
||||
end
|
||||
return tbl
|
||||
end
|
||||
Reference in New Issue
Block a user