get("#175") -- tableToString
get("#349") -- table functions
--startID = "#1000233"
startID = "#2000027"
function printReferenceTree(id, indent, seen)
if seen[id] then
print(indent..id.." (see above)")
else
title = getSnippetTitle(id)
print(indent..id.. " - "..title)
seen[id] = true
local refs = getTitleReferences(id)
--print("Refs: "..tableToString(refs))
for r in all(refs) do
printReferenceTree(r, indent.." ", seen)
end
end
end
print("\nReference tree for "..startID..":\n")
printReferenceTree(startID, "", {})
print()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
| ID | Author/Program | Comment | Date | |
|---|---|---|---|---|
| 347 | #1000604 (pitcher) | 2015-08-18 00:07:22 | ||
| 346 | #1000610 | Edit suggestion: !636 !629 main { static Object androidContext; static String programID; public static void main(String[] args) throws Exception { get("#175") -- tableToString get("#349") -- table functions --startID = "#1000233" startID = "#2000027" function printReferenceTree(id, indent, seen) if seen[id] then print(indent..id.." (see above)") else title = getSnippetTitle(id) print(indent..id.. " - "..title) seen[id] = true local refs = getTitleReferences(id) --print("Refs: "..tableToString(refs)) for r in all(refs) do printReferenceTree(r, indent.." ", seen) end end end print("\nReference tree for "..startID..":\n") printReferenceTree(startID, "", {}) print() }} | 2015-08-18 03:21:30 | delete |
| Snippet ID: | #526 |
| Snippet name: | Print reference tree for #2000027 |
| Eternal ID of this version: | #526/1 |
| Text MD5: | 60145cdcf5a81f38b668c60e2f2f057a |
| Author: | stefan |
| Category: | |
| Type: | Lua code |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2015-03-13 17:42:14 |
| Source code size: | 606 bytes / 27 lines |
| Pitched / IR pitched: | No / Yes |
| Views / Downloads: | 1989 / 302 |
| Referenced in: | #528 - Return reference tree (generic) #1000234 - Print reference tree for #2000044 #3000190 - Answer for stefanreich(>> t 20 questions) #3000382 - Answer for ferdie (>> t = 1, f = 0) #3000383 - Answer for funkoverflow (>> t=1, f=0 okay) |