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

47
LINES

< > BotCompany Repo | #1009225 // Listen-Kernbot [dev.]

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

Libraryless. Click here for Pure Java version (7333L/49K/162K).

!7

concept TheList {
  new L<S> entries;
}

p {
  db();
  if (isMainProgram()) botSleep();
}

synchronized answer {
  if "* zur liste hinzufügen" {
    theList().entries.add($1);
    theList().change();
    ret "OK, hat Position " + l(theList().entries);
  }
  
  if "* an position * zur liste hinzufügen" {
    int i = parseInt($2)-1;
    theList().entries.add(i, $1);
    theList().change();
    ret "OK";
  }
  
  if "* aus der liste nehmen" {
    int i = theList().entries.indexOf($1);
    if (i < 0) ret "Nicht in Liste";
    else {
      theList().entries.remove(i);
      theList().change();
    }
    ret "OK, entfernt aus Position " + (i+1);
  }
  
  if "länge der liste"
    ret lstr(theList().entries);
    
  if "eintrag * der liste" {
    S entry = get(theList().entries, parseInt($1)-1);
    ret entry == null ? "Nix" : "Eintrag: " + quote(entry);
  }
}

static TheList theList() {
  ret uniq(TheList);
}

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: #1009225
Snippet name: Listen-Kernbot [dev.]
Eternal ID of this version: #1009225/6
Text MD5: 78913255da647973873f7452f27dc74f
Transpilation MD5: ba01acd4ad53991ecfd6e3a956a8bb98
Author: stefan
Category: javax / a.i.
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-07-19 03:08:11
Source code size: 968 bytes / 47 lines
Pitched / IR pitched: No / No
Views / Downloads: 487 / 615
Version history: 5 change(s)
Referenced in: [show references]