!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)); }