Libraryless. Click here for Pure Java version (1907L/13K/42K).
1 | !1001816 // a custom translator |
2 | |
3 | m { |
4 | static new MultiSet<S> hitsByIP; |
5 | |
6 | p { |
7 | readLocally("hitsByIP"); |
8 | makeBot("Hit Log."); |
9 | } |
10 | |
11 | static synchronized S answer(S s) { |
12 | new Matches m; |
13 | |
14 | if (match3("note! a hit from ip *", s, m)) { |
15 | hitsByIP.add(m.unq(0)); |
16 | saveLocally("hitsByIP"); |
17 | ret "OK, noted."; |
18 | } |
19 | |
20 | if (match3("get hits from ip *", s, m)) |
21 | ret "" + hitsByIP.get(m.unq(0)); |
22 | |
23 | ret null; |
24 | } |
25 | } |
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: | #1001814 |
Snippet name: | Hit Log |
Eternal ID of this version: | #1001814/1 |
Text MD5: | 038706339fefa433cb4543063a550238 |
Transpilation MD5: | ec57806027201676fb6a35ae3fcb611b |
Author: | stefan |
Category: | |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2015-11-19 17:12:48 |
Source code size: | 480 bytes / 25 lines |
Pitched / IR pitched: | No / Yes |
Views / Downloads: | 581 / 627 |
Referenced in: | [show references] |