Warning: session_start(): open(/var/lib/php/sessions/sess_0p9ndmjmp7ov0nuj20iiags9nk, 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
!759
snew JTextArea thoughtArea;
snew JTextArea chatArea;
snew JTextField chatField;
static new L script;
static int idx;
p {
script = parsePoem("#1003305");
showSideBySide("GMail Bot",
withTitle("Chat", centerAndSouth(chatArea, chatField)),
withTitle("Thoughts", thoughtArea));
chatField.requestFocus();
onEnter(chatField, runnable {
pcall {
if (eq(nextMove(), "move"))
++idx;
}
chatArea.append(chatField.getText() + "\n");
chatField.selectAll();
});
swingEverySecond(thoughtArea, runnable { predict(); });
}
svoid predict {
new StringBuilder buf;
try {
buf.append(unparsePoem(subList(script, idx)) + "\n\n");
S move = nextMove();
buf.append("Probable next move: " + move + "\n\n");
} catch e {
buf.append("\n\n" + getStackTrace(e));
}
setText(thoughtArea, buf);
}
sS nextMove {
S input = chatField.getText();
if (idx >= l(script)) ret "stop";
E e = get(script, idx);
if (e.q != null && match(e.q, input)) ret "move";
ret "stop";
}