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

33
LINES

< > BotCompany Repo | #1003005 // Random Bots List

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (1700L/11K/37K).

!752

static new L<S> randomBots;

p {
  load("randomBots");
}

synchronized answer {
  if (!tb()) null;
  
  if "is * a random bot"
    ret yn(randomBots.contains(m.fsi()));
    
  if "* is a random bot" {
    randomBots.add(m.fsi());
    save("randomBots");
    ret "OK";
  }
  
  if "* is not a random bot" {
    randomBots.remove(m.fsi());
    save("randomBots");
    ret "OK";
  }
  
  if "list random bots"
    ret structure(randomBots);
}

static synchronized boolean isRandomBot(S id) {
  ret randomBots.contains(formatSnippetID(id));
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1003005
Snippet name: Random Bots List
Eternal ID of this version: #1003005/1
Text MD5: 36852965cfef76f5c3e7b4633a578625
Transpilation MD5: da20c0118283183b9779e7ca7c81b0bf
Author: stefan
Category: eleu / nl
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-04-17 21:39:18
Source code size: 576 bytes / 33 lines
Pitched / IR pitched: No / No
Views / Downloads: 613 / 1002
Referenced in: [show references]