Source Code
<!doctype html>
<html>
<head>
<title>Oracle</title>
<style>
body { padding: 10px; }
.qa .q:not(:empty)::before { content: "Q: " }
.qa .a:not(:empty)::before { content: "A: " }
</style>
</head>
<?
eightball("It is certain").
eightball("It is decidedly so").
eightball("Without a doubt").
eightball("Yes, definitely").
eightball("You may rely on it").
eightball("As I see it, yes").
eightball("Most likely").
eightball("Outlook good").
eightball("Yes").
eightball("Signs point to yes").
eightball("Reply hazy try again").
eightball("Ask again later").
eightball("Better not tell you now").
eightball("Cannot predict now").
eightball("Concentrate and ask again").
eightball("Don't count on it").
eightball("My reply is no").
eightball("My sources say no").
eightball("Outlook not so good").
eightball("Very doubtful").
oracle(Question, Wisdom) :-
findall(X, eightball(X), All),
length(All, Len),
term_hash(Question, Hash),
date_time(_, M, D, _, _, _),
Index is (Hash + M*D) mod Len,
nth0(Index, All, Wisdom).
?>
<body>
<h1>Oracle of Facts and Logic</h1>
<main>
<form method="POST" enctype="application/x-www-form-urlencoded">
<input type="text" name="ask" placeholder="ASK ME ANYTHING"
style="width: 80ch;" value="<?=X form_value(ask, X) ?>"
autofocus>
<input type="submit" value="Ask">
</form>
<article class="qa">
<h3 class="q"><?=Ask form_value(ask, Ask). ?></h3>
<h3 class="a"><?=Wisdom form_value(ask, Ask), oracle(Ask, Wisdom). ?></h3>
</article>
</main>
<hr>
<section>
<h2>Source Code</h2>
<pre><?=Source current_file(File), read_file_to_string(File, Source, []). ?></pre>
</section>
<hr>
<footer>
powered by <a href="https://github.com/guregu/php">php</a>
</footer>
</body>
</html>