function msinsert(tbl, value) tbl[value] = tbl[value] and tbl[value]+1 or 1 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: | #390 |
Snippet name: | msinsert (multiset insert) |
Eternal ID of this version: | #390/1 |
Text MD5: | ba55200a2bc8d036663e10bd5fe08ea9 |
Author: | stefan |
Category: | table functions |
Type: | Lua code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2015-02-03 18:12:16 |
Source code size: | 83 bytes / 3 lines |
Pitched / IR pitched: | No / Yes |
Views / Downloads: | 709 / 202 |
Referenced in: | [show references] |