;;; THIS IS HOW DUMB I AM THAT I HAD TO WRITE THIS. ;;; Now I see how easy and not scrambled the words are. ;;; ;;; unscramble.lisp - Try to unscrable a word in a dictionary. ;;; (defpackage :unscramble (:documentation "Try to unscrable a word in a dictionary.") (:use :cl :dlib) (:export #:unscramble )) (in-package :unscramble) ;; Try to unscramble shinmera's captcha ;; https://plaster.tymoon.eu/edit (defvar *words* nil) (when (not *words*) (setf *words* (get-lines "/usr/share/dict/words"))) (defun unscramble (word) (let ((targ (coerce word 'list)) tt) (loop :for w :in *words* :do (when (= (length w) (length word)) (setf tt (copy-list targ)) (loop :for c :across w :do (setf tt (delete c tt :count 1 :test #'eql))) (when (zerop (length tt)) (format t "~a~%" w))))))