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

3
LINES

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

Lua code

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: 712 / 203
Referenced in: #383 - Battery Symbol Finder
#394 - Battery Symbol Finder (optimized)
#413 - Symbol Finder (include)
#3000382 - Answer for ferdie (>> t = 1, f = 0)
#3000383 - Answer for funkoverflow (>> t=1, f=0 okay)