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

25
LINES

< > BotCompany Repo | #1018194 // Interpret Program 1 [OK]

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

Download Jar. Libraryless. Click here for Pure Java version (13559L/76K).

!7

p-exp {
  BakedBot bot = bakedBotWithRules([[
    [id: yes, trumps unknown] i(is $x $y?) && fact($x is $y) => o(yes)
    
    [id: no, trumps unknown] i(is $x $y?) && fact($x is not $y) => o(no)
    
    [id: unknown] anyInput() => o(unknown)
  ]]);
  set(bot.factsBot(), standardGrouper := func(S s) -> S {
    ai_groupSimplestNounPhrasesIfUngrouped(s)
  });
  
  for (S s : tlft(mL_raw("Program 1"))) {
    L<S> l = splitAtSingleArrow(s);
    if (l(l) == 2) {
      bot.answerAuthed("!groupFacts");
      bot.pcheck(first(l), second(l));
    } else
      bot.addFact(s);
  }
  
  bot.printTestStats();
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1018194
Snippet name: Interpret Program 1 [OK]
Eternal ID of this version: #1018194/11
Text MD5: a203848918df4ae1d51e6343865b96a7
Transpilation MD5: 77d13824d9edfae380d5e38833be4ab9
Author: stefan
Category: javax / a.i.
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-09-09 19:05:57
Source code size: 633 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 365 / 800
Version history: 10 change(s)
Referenced in: [show references]