Hmm I have a reference to something in the yawl module I feel like might just be a file of all the words (words.lisp)
Viewing post in Feedback for future devlog posts for my jam?
Anyway I changed *valid-word* (I guess just wanting an asdf system is the previous version) to
(defvar *valid-words* (let ((ht (make-hash-table :test 'equal))) (loop for word in (apply 'append *bucketed-words*) do (setf (gethash word ht) t))))
(Yes I know, but there aren't that many words.).
Then I was able to
$ rlwrap ecl > (require "thirteen-words") > (13l:menu)
Also I missed that the game is that every wrong guess reveals a character. I thought you were asking me to just unscramble thirteen letters cold. So I
(defun delete-1st (ch list) (let ((idx (search `(,ch) list)) (cond ((null idx) list) (= idx (1- (length list)) (butlast list)) (t (append (subseq list 0 idx) (subseq list (1+ idx)))))) (defun word-has (word letters) (loop for lord = (coerce word 'list) then (delete-1st ch lord) for ch across letters when (not (member ch lord)) do (return-from word-has nil)) (list word)) (defun cheat (letters) (loop for word in (apply 'append *bucketed-words*) nconc (word-has word letters)))
;p my score is very good...
Ah, I broke the console version while making the web one. Sorry about that!
I think it would work if you synced the Git sub module (something I should add to the instructions). But fortunately for you *valid-words* is only used on the web server, so even just making it nil should make the console game run 🙂
Thanks for giving it a spin!
I didn't see anything built-in, although it looks like there is at least one library: https://github.com/samebchase/hash-set/