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; }
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: | 791 / 720 |
Referenced in: | #1001945 - Add/Minus/Mul/Div/Pot Bot (with wrong precedence ^^) #3000202 - Answer for stefanreich (>> T conversion bot) #3000238 - Answer for stefanreich (>> t power bot) #3000382 - Answer for ferdie (>> t = 1, f = 0) |