2 ms·
I found the source code to be absolutely fascinating, beautifully written, easy to parse and understand why and how various actions will happen. Here's an exam
by Twirrim 9y ago
I found the source code to be absolutely fascinating, beautifully written, easy to parse and understand why and how various actions will happen.
Here's an example method:
https://github.com/krajj7/BotHack/blob/master/src/bothack/behaviors.clj#L43 https://github.com/krajj7/BotHack/blob/master/src/bothack/be...
(defn- read-book [game]
{:pre [(have game book #{:noncursed})]}
(if-not (invocation-complete? game)
(if-let [[slot _] (have game "Book of the Dead")]
(with-reason "reading the book"
(->Read slot)))))