Warning: session_start(): open(/var/lib/php/sessions/sess_5inspgvvcv47fmjptq4fn5lo1g, 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
static L instructions;
static volatile L topic;
static WebNode source;
p {
instructions = indexedNodes("If starts with");
bot();
centerBiggerConsole();
consoleInput("What do you know about Gaga?");
askButton();
}
answer {
if "source" ret source.web.source;
for (WebNode instruction : instructions) {
WebNode op = web_operand(instruction);
if (matchStart(web_unquote(op), s, m)) {
WebNode i = web_operand(op);
S what = web_text(i);
if (eqic(what, "get topic $1")) {
getTopic(m.rest());
ret anyFactAbout(source = first(topic));
} else
ret "huh? " + what;
}
}
}
svoid getTopic(S topic) {
main.topic = indexedNodes(topic);
print("Got topic: " + topic + " => " + n(main.topic, "node"));
}
sS anyFactAbout(WebNode node) {
Triple t = web_mostInterestingConnection(node);
if (t == null) ret "No idea about " + node;
ret web_text(t.a) + " " + t.b + " " + web_text(t.c) + ".";
}