get("#515") -- splitLines
text1 = getSnippet("#2000014")
text2 = getSnippet("#2000003")
lines1 = splitLines(text1)
lines2 = splitLines(text2)
n = math.max(#lines1, #lines2)
w = 0
for i=1, #lines1 do
w = math.max(w, #lines1[i])
end
for i=1, n do
line1 = lines1[i] or ""
line2 = lines2[i] or ""
print(line1..string.rep(" ", w-#line1).." | "..line2)
end
test run test run with input download show line numbers
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #513 |
| Snippet name: | Snippet merger (side by side) |
| Eternal ID of this version: | #513/1 |
| Text MD5: | b6e8185a8313078ec96c59b3f1ca8635 |
| Author: | stefan |
| Category: | |
| Type: | Lua code |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2015-03-11 15:03:02 |
| Source code size: | 382 bytes / 19 lines |
| Pitched / IR pitched: | No / Yes |
| Views / Downloads: | 860 / 221 |
| Referenced in: | #517 - mergeTexts (side by side merger, include) #2000015 - Side-by-side of #2000014 and #2000003 #3000190 - Answer for stefanreich(>> t 20 questions) #3000382 - Answer for ferdie (>> t = 1, f = 0) #3000383 - Answer for funkoverflow (>> t=1, f=0 okay) |