Warning: session_start(): open(/var/lib/php/sessions/sess_5571sa05p9eajnlm494u71634s, 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
set flag AllowMetaCode. set flag Reparse. meta-transformNow { tok_standardBot }
standard bot TheAIShould {
allServers {
static noeq record Entry(S text) extends HasGlobalID {}
}
Map db = ciMap();
S add(S s) {
if (!db.containsKey(s)) { db.put(s, new Entry(s)); change(); ret "OK, stored"; }
ret "I know";
}
S remove(S s) { ret db.remove(s) != null ? with(r change, "OK, then not") : "I know"; }
S listWithPattern(S pat) { ret or2(lines(mapValuesToList(db, x -> format_ellipsis(pat, x.text))), "nothing"); }
sync S processSimplifiedLine(S s, O... _) {
try answer super.processSimplifiedLine(s, _);
new Matches m;
meta {
S program = [[
The AI should ... = +
The AI doesn't have to ... = -
What should the AI do = listWithPattern("The AI should ...")
]];
ret ai_lineEquationsToMatchX2Statements(jreplace_multi(program,
"+", "add(\\$1);",
"-", "remove(\\$1);"));
}
null;
}
}