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

26
LINES

< > BotCompany Repo | #1001310 // Leo logic

JavaX fragment (include)

1  
static synchronized S answer(S s, L<S> history) {
2  
  if (match3("wie hei\u00dft du", s))
3  
    return "Leopold";
4  
  
5  
  if (match3("wie ist deutschland", s)) {
6  
    unhappy();
7  
    return "es ist h\u00e4sslich";
8  
  }
9  
  
10  
  if (match3("wie ist \u00f6sterreich", s)) {
11  
    happy();
12  
    return "es ist sehr sch\u00f6n";
13  
  }
14  
    
15  
  /*if (match3("du bist lustig", s)) {
16  
    happy();
17  
    return "danke sch\u00f6n";
18  
  }*/
19  
  
20  
  // user input plus last Leo output and last user input
21  
  S bla = structure(history.subList(Math.max(0, history.size()-3), history.size()));
22  
  S answer = sendToRemoteBot("Leo Bot", "!" + bla);
23  
  happy(); 
24  
   
25  
  return answer;
26  
}

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: #1001310
Snippet name: Leo logic
Eternal ID of this version: #1001310/1
Text MD5: 4fa96340eb7b455d0099049c7f7c0074
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-10-09 17:03:53
Source code size: 662 bytes / 26 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 527 / 903
Referenced in: [show references]