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

32
LINES

< > BotCompany Repo | #1002970 // Dem Puppet (#talkingbots)

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

Libraryless. Click here for Pure Java version (1874L/12K/40K).

1  
!752
2  
3  
static S prefix = "[eleu]";
4  
5  
static PersistentMap<S, S> inToOut;
6  
7  
p {
8  
  inToOut = new PersistentMap("inToOut");
9  
  noteLast_load();
10  
}
11  
12  
synchronized answer {
13  
  if (neq(getChannel(), "devchannel, #talkingbots")) null;
14  
  
15  
  S last = noteLast(s);
16  
  S in = simplifySentence2(s);
17  
  
18  
  // check store prefix
19  
  s = s.trim();
20  
  if (swic(s, prefix)) {
21  
    S response = dropPrefixIgnoreCase(prefix, s).trim();
22  
    S lastIn =simplifySentence2(last);
23  
    print("puppet save: " + lastIn + ", out=" + response);
24  
    inToOut.put(lastIn, response);
25  
    ret response;
26  
  }
27  
  
28  
  S out = inToOut.get(in);
29  
  print("in=" + in + ", out=" + out);
30  
  if (nempty(out))
31  
    ret out;
32  
}

Author comment

Began life as a copy of #1002967

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: #1002970
Snippet name: Dem Puppet (#talkingbots)
Eternal ID of this version: #1002970/1
Text MD5: 08d0752469924feda636eef23d209234
Transpilation MD5: c21f55a62eb5bb83fb1dbc684c73637f
Author: stefan
Category: nl bots
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-04-14 18:33:41
Source code size: 693 bytes / 32 lines
Pitched / IR pitched: No / No
Views / Downloads: 698 / 1045
Referenced in: [show references]