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

11
LINES

< > BotCompany Repo | #1020947 // dm_moduleByNameFragment

JavaX fragment (include)

sS dm_moduleByNameFragment(S name) {
  new Best<S> best;
  for (S id : dm_listModuleIDs()) {
    S m = dm_moduleName(id);
    int score = 0;
    if (swic(m, name)) score = 2;
    else if (cic(m, name)) score = 1;
    if (score > 0) best.put(id, score);
  }
  ret best!;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1020947
Snippet name: dm_moduleByNameFragment
Eternal ID of this version: #1020947/2
Text MD5: 0d29cada75a42b5e5b0f4dd889af12d9
Author: stefan
Category: javax / stefan's os
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-01-16 01:02:31
Source code size: 281 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 270 / 319
Version history: 1 change(s)
Referenced in: [show references]