Warning: session_start(): open(/var/lib/php/sessions/sess_am1mlo4aq8grr9cmgp5vaf64a7, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
sS theRiddle = [[
X is the first word in my text.
Is my text a letter or a program?
]];
sS theFacts = [[
"!" is a typical first word in a program.
"Hello" is a typical first word in a letter.
cdtwmxtqspigpyap confirms mibnjwgfxnetaxyz.
]];
sS concepts = [[
["zcprevyllqdmyvcn", "Is X a Y or a Z?"],
["mibnjwgfxnetaxyz", "X is the first word in Y."],
["cdtwmxtqspigpyap", "X is a typical first word in a Y."],
["kdpoqkaoypqenusd", "X confirms Y."]
]];
static JTextArea ta;
static new L facts;
static ReliableSingleThread computer = new ReliableSingleThread(f think);
p-substance-noconsole {
aiEnhancements();
useConceptsDump(concepts);
facts = clParse(linesToCL(theFacts));
onChangeAndNow(ta = showText(""), r { computer.go() });
}
svoid think {
time {
S riddle = formatXYZ(theRiddle, quote(firstWord2(getText(ta))));
L localFacts = concatLists(facts, clParse(sentencesToCL(riddle)));
S answer = solveRiddle(localFacts);
S type = conceptToName(answer);
titleStatus_trailing(ta, empty(type) ? null : "Writing a " + type);
}
}
// returns concept ID or null
static S solveRiddle(L facts) {
// Find the question
Lisp q = assertNotNull("No question found", findHead(facts, "zcprevyllqdmyvcn"));
L candidates = ll(q.s(1), q.s(2));
ret web_candidateWithMostConfirms(facts, q.s(0), candidates);
}