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

3
LINES

< > BotCompany Repo | #390 // msinsert (multiset insert)

Lua code

1  
function msinsert(tbl, value)
2  
  tbl[value] = tbl[value] and tbl[value]+1 or 1
3  
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: 711 / 202
Referenced in: [show references]