Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn markov-chain [index key]
- "Lazily creates a markov chain"
- (let [completion (markov-next index key)
- next-key (nthrest (concat key completion) (count completion))]
- (if (nil? completion)
- '()
- (lazy-cons (first completion) (markov-chain index next-key)))))
Add Comment
Please, Sign In to add comment