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

20
LINES

< > BotCompany Repo | #1001943 // Add Bot

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

Libraryless. Click here for Pure Java version (1625L/11K/36K).

!752

p {
  makeBot("Add Bot.");
}

static S answer(S s) {
  L<S> tok = javaTok(s);
  int i;
  Long result = null;
  while ((i = matchMeta(tok, "<number>", "+", "<number>")) >= 0) {
    long a = parseLong(tok.get(i)), b = parseLong(tok.get(i+4));
    result = a+b;
    clearAllTokens(tok.subList(i, i+5));
    tok.set(i, "" + result);
    tok = javaTok(tok);
  }
  if (result != null) ret "" + result;
  ret null;
}

Author comment

Began life as a copy of #1001942

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1001943
Snippet name: Add Bot
Eternal ID of this version: #1001943/1
Text MD5: b8a939a0dad33d9eafb6b679f777d7a4
Transpilation MD5: 50c919ce6b334e07a4b0bac09be22dc0
Author: stefan
Category:
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-12-09 01:07:08
Source code size: 436 bytes / 20 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 789 / 716
Referenced in: [show references]