1 | local lines = {} |
2 | for k, v in pairs(_G) do |
3 | if type(v) == 'number' then |
4 | table.insert(lines, k..'='..tostring(v)) |
5 | elseif type(v) == 'string' then |
6 | table.insert(lines, k..'='..('%q'):format(v)) |
7 | end |
8 | end |
9 | return table.concat(lines, "\\n") |
Initial version of #151 that could handle only numbers and strings. And no special characters in _G keys, but that is nasty anyways, nobody does it!
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
Recognizer | Recognition Result | Visualize | Recalc |
---|---|---|---|
#308 | 252 | [visualize] |
Snippet ID: | #152 |
Snippet name: | luaPrintVars, initial version |
Eternal ID of this version: | #152/1 |
Text MD5: | 861b108220ddb71db7ed7d174c41b73a |
Author: | stefan |
Category: | internal helpers |
Type: | Lua code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2014-01-13 03:23:53 |
Source code size: | 252 bytes / 9 lines |
Pitched / IR pitched: | Yes / Yes |
Views / Downloads: | 918 / 217 |
Referenced in: | [show references] |