Guest User

Untitled

a guest
May 27th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. (defn markov-chain [index key]
  2. "Lazily creates a markov chain"
  3. (let [completion (markov-next index key)
  4. next-key (nthrest (concat key completion) (count completion))]
  5. (if (nil? completion)
  6. '()
  7. (lazy-cons (first completion) (markov-chain index next-key)))))
Add Comment
Please, Sign In to add comment