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

15
LINES

< > BotCompany Repo | #1013172 // ai_ifAndInput

JavaX fragment (include)

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

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: 303 / 344
Version history: 14 change(s)
Referenced in: [show references]