There seems to be an odd predicament when choosing a section to post code in.
Code that functions as a program is posted in the "Programs" section, and a class or API would go into the "API" section
However, what about code that has no particular use in any of the fore-mentioned sections, such as small lines or functions that would aid in a bigger program (a snippet)? A section with such a function would benefit not only new programs, but also coders who want an easy repository to find a piece of code they have been struggling with.
A couple of examples would be:
"Find What a Peripheral Can Do"
http://www.computerc...ipheral-can-do/
local tArgs = {...}
per = tArgs[1]
for i,v in ipairs(peripheral.getMethods(per))
do print(i..". "..v)
endWhich was then turned into:for i,v in pairs(peripheral.getMethods(...)) do print (i..". "..v) endAnd finally:textutils.tabulate(peripheral.getMethods(...))"Advanced Computer Detection"
From:
local advancedComputer = false
if term.isColor then
advancedComputer = true
endTo:local advancedComputer = term.isColor and true or falseWith simple snippets that could be further broken down into efficient lines of code would surely benefit any coder.
If this has been suggested, it must have missed my search results.
Thank you for your time,
Kind regards,
Kind-Sir