Warning: session_start(): open(/var/lib/php/sessions/sess_vsgq5c84e6bg7hmq5lvq22epav, 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 = [[
Q: What did Magnus Carlsen eat for breakfast?
]];
sS theFacts = [[
Magnus Carlsen lives in Norway.
In Norway, they eat fish.
(Q: What did X eat for breakfast?) and (X lives in Y.) and (In Y, they eat Z.) => (A: Probably Z!)
]];
sS concepts = [[
["vouwrrhtmajsgaby", "Q: X"],
["nywfcwkkcknzhmdy", "A: X"],
["zlydvmmyckgcyrak", "Magnus Carlsen"],
["verqumbshvchuquw", "Norway"],
["wvqzrhdaqnygqgll", "Fish"],
["bzvabitchqhqkldm", "In X, they eat Y."],
["pizxszvxocdluica", "What did X eat for Y?"],
["fhsukilpoasgkvcs", "X lives in Y."],
["oceicdfeiyftxuwi", "Probably X!"],
["eijdjqhyzheusetj", "(X) and (Y) and (Z) => (AA)"],
//["mcoswmplpqlieruo", "(X)"],
//["mwpbetwhkuuuupws", "X and Y and Z => AA"],
]];
svoid createWeb(Web web, Lisp riddle) {}
svoid calc(Web web, Lisp riddle) {
print("Vars: " + vars);
for (LispStatement ls : lispStatementsByHead("eijdjqhyzheusetj")) {
Lisp rule = ls.term;
L conditions = dropLast(rule.args);
Lisp out = last(rule.args);
new Map matches;
if (matchConditions(conditions, matches, riddle)) {
print("Yo! " + struct(matches));
web.node(lispReplaceVars(out, matches));
}
}
}
static bool matchConditions(L conditions, Map m, Lisp riddle) {
if (empty(conditions)) true;
Lisp cond = first(conditions);
for (Lisp fact : concatLists(ll(riddle), facts)) {
Map m2 = cloneMap(m);
if (lispMatch_sub(cond, fact, vars, m2)) {
if (matchConditions(dropFirst(conditions), m2, riddle)) {
m.putAll(m2);
true;
}
}
}
false;
}
sS getAnswer(Web web) {
Lisp l = web_nodeByHead(web, "nywfcwkkcknzhmdy");
ret crazyEnglishFixing(conceptLanguageToEnglish_rec(l));
}
p {
setConsoleInput(trim(firstLine(theRiddle)));
pConsoleThoughtMachine();
}
!include #1007815 // Console Thought Machine