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

15
LINES

< > BotCompany Repo | #1013172 // ai_ifAndInput

JavaX fragment (include)

1  
static S ai_ifAndInput(S rule, S input) {
2  
  rule = unquote(rule);
3  
  if (containsJavaToken(rule, "Y"))
4  
    ret ai_ifAndInput_v2(rule, input);
5  
  
6  
  new Matches m;
7  
  if (!simpleStarMatchOnCTokensIC("if * and input * then say *",
8  
    javaTokDroppingBracketsC(rule), m)) unsuitableRule();
9  
  if (!match($2, input)) null;
10  
  T3<S> t = ai_tripelize(ai_bigXToDollarX($1));
11  
  printStruct(+t);
12  
  S x = random(ai_texts(t));
13  
  if (x == null) null;
14  
  ret ai_replaceBigX($3, x);
15  
}

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: #1013172
Snippet name: ai_ifAndInput
Eternal ID of this version: #1013172/15
Text MD5: 922d71cdf8700a6eb37b5727727b3fc8
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-27 07:09:33
Source code size: 478 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 372 / 414
Version history: 14 change(s)
Referenced in: [show references]