Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #127 // Snippet combiner (loadSnippets)

Lua code

1  
local split = extractFromSnippet(125, 'split')
2  
3  
-- takes list of snippet IDs as input, e.g. "118 124"
4  
-- env may be nil, then it's _G (as with loadSnippet)
5  
-- Note: loadSnippets does not require the extra ().
6  
-- So it's not loadSnippets(...)() - just one set of
7  
-- brackets.
8  
function loadSnippets(snippets, env)
9  
  for _, s in ipairs(split(snippets)) do
10  
    loadSnippet(s, env)()
11  
  end
12  
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

Image recognition results

Recognizer Recognition Result Visualize Recalc
#308 399 [visualize]

Snippet ID: #127
Snippet name: Snippet combiner (loadSnippets)
Eternal ID of this version: #127/1
Text MD5: c13863b82dcf05739ce0b0b8b642841d
Author: stefan
Category: wrappers
Type: Lua code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2014-01-10 17:58:09
Source code size: 399 bytes / 12 lines
Pitched / IR pitched: Yes / Yes
Views / Downloads: 1048 / 580
Referenced in: [show references]