Libraryless. Click here for Pure Java version (1573L/11K/35K).
!752 p { makeBot("Add Bot."); } static S answer(S s) { L<S> tok = javaTok(s); int i; BigInteger result = null; for (S op : litlist("+", "-", "*", "/", "^")) { while ((i = matchMetaNoStar(tok, "<number>", op, "<number>")) >= 0) { BigInteger a = new BigInteger(tok.get(i)), b = new BigInteger(tok.get(i+4)); result = mathOp(op, 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 #1001943
download show line numbers debug dex old transpilations
Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, jtubtzbbkimh, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, teubizvjbppd, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment