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

32
LINES

< > BotCompany Repo | #1006408 - Computer! Can we...? [dev.]

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

Libraryless. Click here for Pure Java version (4532L/33K/99K).

!7

/*
proc "Computer! Can we $task?" {
  find $program that fulfills $task;
  if ($program != null)
    print("Yes, with this program: " + programInfo($program));
  else
    print("I did not find a program for that.");
}
*/

p-type {
  makeBot();
}

answer {
  if (flexMatchDropPunctuation("Computer! Can we *?", s, m)
    || flexMatchDropPunctuation("Can we *?", s, m)) {
    S task = $1;
    print("Looking for " + quote(task) + "...");
    Snippet program = findProgramThatFulfills(task);
    if (program != null)
      ret "Maybe with this program? " + snippetWithTitle(program);
    else
      ret "I did not find a program for that.";
  }
}

static Snippet findProgramThatFulfills(S task) {
  ret first(tbSearchRunnableQuick(1, task));
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1006408
Snippet name: Computer! Can we...? [dev.]
Eternal ID of this version: #1006408/1
Text MD5: 4c88bf7b19d3a8adb34bad7b4d7c1eaa
Transpilation MD5: 500d56ada16d9693e9974c0921a2b479
Author: stefan
Category: javax / a.i.
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-01-01 18:50:54
Source code size: 775 bytes / 32 lines
Pitched / IR pitched: No / No
Views / Downloads: 361 / 437
Referenced in: [show references]