Skip to content

Instantly share code, notes, and snippets.

@olaugh
Created February 25, 2009 00:28
Show Gist options
  • Save olaugh/69906 to your computer and use it in GitHub Desktop.
Save olaugh/69906 to your computer and use it in GitHub Desktop.
(defun a-hooks ()
(let* ((sevens (make-hash-table :test 'equal))
(eights (with-open-file (stream "/home/john/scrabble/twl.txt")
(loop
for word = (read-line stream nil) while word
for length = (length word)
when (= 7 length)
do (setf (gethash word sevens) t)
when (and (= 8 length)
(char= #\A (elt word 0)))
collect word))))
(dolist (eight eights)
(when (gethash (subseq eight 1) sevens)
(format t "~a~%" eight)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment