-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
clean: | ||
lein clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
; https://www.npr.org/2023/08/13/1193621080/sunday-puzzle-fill-in-the-blank | ||
|
||
; Name a famous contemporary singer (6,4). The second, fourth, sixth, eighth, and ninth letters, in order, spell a repeated part of a song that everyone knows. What is it? | ||
|
||
(defn clean-up-word [word] | ||
(clojure.string/replace (clojure.string/lower-case word) #"[^a-z]" "")) | ||
|
||
(def six-four | ||
(->> "resources/64.txt" | ||
slurp | ||
clojure.string/split-lines)) | ||
|
||
(def ospd | ||
(->> "resources/ospd3.txt" | ||
slurp | ||
clojure.string/split-lines | ||
set)) | ||
|
||
(defn transform-name [n] | ||
(let [[_ a _ b _ c _ _ d e _] (map char n)] | ||
(str a b c d e))) | ||
|
||
(def candidates | ||
(->> six-four | ||
(mapv (juxt identity (comp transform-name clean-up-word))) | ||
(filter (comp (partial = 5) count last)) | ||
distinct)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
; https://www.npr.org/2023/08/20/1194416790/sunday-puzzle-you-better-make-it-last | ||
|
||
; Name part of the human body above the neck in 9 letters. Rearrange them | ||
; to name another part of the human body found below the neck. Only some | ||
; people have the first body part. Everyone has the second one. What | ||
; parts of the human body are these? | ||
|
||
(defn clean-up-word [word] | ||
(clojure.string/replace (clojure.string/lower-case word) #"[^a-z]" "")) | ||
|
||
(def body-parts | ||
(->> "resources/body_parts.txt" | ||
slurp | ||
clojure.string/split-lines | ||
(mapv clean-up-word))) | ||
|
||
(def nines | ||
(filter (comp (partial = 9) count) body-parts)) | ||
|
||
(map val (group-by frequencies nines)) | ||
|
||
|