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
(let [symmetrical-chars "!\"'+*-.:=AHIMOTUVWXY^_ovwx| " | |
symmetrical-pairs "()<>[]{}qpbd/\\" | |
lookup-table (->> symmetrical-pairs | |
((juxt seq reverse)) | |
(apply concat) | |
(partition 2) | |
(map vec) | |
(into {}) | |
(merge (zipmap symmetrical-chars | |
symmetrical-chars)))] |
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
(ns daily.ordering | |
;; Include [org.clojure/core.match "0.3.0-alpha5"] in project deps | |
(:require [clojure.core.match :refer [match]] | |
[clojure.string :as string]) | |
(:import java.text.Normalizer)) | |
(defn ordered? | |
([coll] | |
(ordered? compare coll)) | |
([^java.util.Comparator cmp coll] |
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
(ns daily.rpn | |
;; Needs [instaparse "1.4.7"] in project deps | |
(:require [instaparse.core :as insta] | |
[instaparse.failure :as failure] | |
[clojure.string :as string] | |
[clojure.edn :as edn])) | |
(def whitespace | |
(insta/parser | |
"whitespace = #'\\s*'")) |
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
(ns daily.alliteration | |
(:require [clojure.string :as string])) | |
(def stopwords #{"i" "a" "about" "an" "and" "are" "as" | |
"at" "be" "by" "com" "for" "from" "how" | |
"in" "is" "it" "of" "on" "or" "that" | |
"the" "this" "to" "was" "what" "when" | |
"where" "who" "will" "with"}) | |
(defn alliterations |
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
(ns daily.similar-frequencies | |
(:require [clojure.string :as string] | |
[clojure.java.io :as io])) | |
(def word-file "resources/google-10000-english-no-swears.txt") | |
;; A vector containing all words in the dataset | |
(def words | |
(with-open [rdr (io/reader word-file)] | |
(->> rdr |
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
(ns luhn.core) | |
(defn sum-digits [n] | |
(->> n | |
str | |
(mapv (comp #(- % 48) int)) | |
(reduce +))) | |
(defn luhn-checksum [n] | |
(->> n |
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
boot.user> (start-repl) | |
<< started Weasel server on ws://127.0.0.1:35242 >> | |
<< waiting for client to connect ... java.lang.NullPointerException | |
at clojure.java.io$make_parents.doInvoke(io.clj:433) | |
at clojure.lang.RestFn.invoke(RestFn.java:410) | |
at adzerk.boot_cljs_repl$make_repl_connect_file.invoke(boot_cljs_repl.clj:43) | |
at adzerk.boot_cljs_repl$write_repl_connect_file.invoke(boot_cljs_repl.clj:59) | |
at adzerk.boot_cljs_repl$repl_env$fn__505.invoke(boot_cljs_repl.clj:104) | |
at weasel.repl.websocket$websocket_setup_env.invoke(websocket.clj:72) | |
at weasel.repl.websocket.WebsocketEnv._setup(websocket.clj:27) |
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
/** | |
* Copyright 2015 Netflix, Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
Eldritch can seem ugly and hard, but it's fun game once you push through the learning curve. | |
For a game with so many right angles, it feels surprisingly non-Euclidean! I was pretty | |
underwhelmed th first two times I tried the game out, but the third time it really clicked... | |
it's now a definitefavorite. | |
Here are a few suggestions to make it up that initial ramp. Some of these might be considered | |
spoilery, but if they get you to actually play the game, who's going to kick? | |
(1) _Don't_ loot bodies until you're better at the game. Looted enemies respawn; by clearing them | |
out, you buy yourself breathing space. |