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

11
LINES

< > BotCompany Repo | #1020947 // dm_moduleByNameFragment

JavaX fragment (include)

1  
sS dm_moduleByNameFragment(S name) {
2  
  new Best<S> best;
3  
  for (S id : dm_listModuleIDs()) {
4  
    S m = dm_moduleName(id);
5  
    int score = 0;
6  
    if (swic(m, name)) score = 2;
7  
    else if (cic(m, name)) score = 1;
8  
    if (score > 0) best.put(id, score);
9  
  }
10  
  ret best!;
11  
}

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: 199 / 255
Version history: 1 change(s)
Referenced in: [show references]