diff options
| author | Tyler Wardhaugh <twardhaugh@cap-rx.com> | 2021-10-15 12:39:43 -0700 |
|---|---|---|
| committer | Tyler Wardhaugh <twardhaugh@cap-rx.com> | 2021-10-15 12:39:43 -0700 |
| commit | a4d967426cafe6428633c0c52ecc0459dae6b338 (patch) | |
| tree | dc8377713df86d1f335500b696e6ca7bf37f904b | |
| parent | 7f103dc8430b8194e2d5d96c5d675a9d9fff20f2 (diff) | |
| download | perlweeklychallenge-club-a4d967426cafe6428633c0c52ecc0459dae6b338.tar.gz perlweeklychallenge-club-a4d967426cafe6428633c0c52ecc0459dae6b338.tar.bz2 perlweeklychallenge-club-a4d967426cafe6428633c0c52ecc0459dae6b338.zip | |
Ch134 (Clojure): prep for challenge
9 files changed, 67 insertions, 10 deletions
diff --git a/challenge-134/tyler-wardhaugh/clojure/.projections.json b/challenge-134/tyler-wardhaugh/clojure/.projections.json new file mode 100644 index 0000000000..fd1070320a --- /dev/null +++ b/challenge-134/tyler-wardhaugh/clojure/.projections.json @@ -0,0 +1,10 @@ +{ + "src/*.clj": { + "alternate": "test/{}_test.clj", + "type": "source" + }, + "test/*_test.clj": { + "alternate": "src/{}.clj", + "type": "test" + } +}
\ No newline at end of file diff --git a/challenge-134/tyler-wardhaugh/clojure/README.md b/challenge-134/tyler-wardhaugh/clojure/README.md index 7455be8203..d6703ce23a 100644 --- a/challenge-134/tyler-wardhaugh/clojure/README.md +++ b/challenge-134/tyler-wardhaugh/clojure/README.md @@ -1,7 +1,7 @@ -# tw.weekly.c133 +# tw.weekly.c134 -The Weekly Challenge - #133 - Tyler Wardhaugh +The Weekly Challenge - #134 - Tyler Wardhaugh ## Usage @@ -9,7 +9,7 @@ Clojure ([installation instructions](https://clojure.org/guides/getting_started# Run the project directly (shows default output from both tasks): - $ clojure -M -m tw.weekly.c133.core + $ clojure -M -m tw.weekly.c134.core # ... or ... $ bb run both @@ -21,13 +21,13 @@ Run the project's tests (which are samples from the task descriptions): Run Task #1 with input - $ clojure -M -m tw.weekly.c133.t1 N + $ clojure -M -m tw.weekly.c134.t1 N # ... or ... $ bb run task-1 N Run Task #2 with input: - $ clojure -M -m tw.weekly.c133.t2 N + $ clojure -M -m tw.weekly.c134.t2 N # ... or ... $ bb run task-2 N diff --git a/challenge-134/tyler-wardhaugh/clojure/bb.edn b/challenge-134/tyler-wardhaugh/clojure/bb.edn index 4cd11817b8..69331331eb 100644 --- a/challenge-134/tyler-wardhaugh/clojure/bb.edn +++ b/challenge-134/tyler-wardhaugh/clojure/bb.edn @@ -31,7 +31,8 @@ (apply shell bb-cmd args)))) clean {:doc "Clean out temporary files" - :task (run! fs/delete-tree [".nrepl-port" ".cpcache" ".lsp"])} + :task (run! fs/delete-tree + [".nrepl-port" ".cpcache" ".lsp" ".clj-kondo"])} generate-pom {:doc "Generate POM file" :task (clojure "-X:deps mvn-pom")} diff --git a/challenge-134/tyler-wardhaugh/clojure/pom.xml b/challenge-134/tyler-wardhaugh/clojure/pom.xml index fce28c3b21..3a14ee2365 100644 --- a/challenge-134/tyler-wardhaugh/clojure/pom.xml +++ b/challenge-134/tyler-wardhaugh/clojure/pom.xml @@ -2,11 +2,11 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>tw.weekly</groupId> - <artifactId>tw.weekly.c133</artifactId> + <artifactId>tw.weekly.c134</artifactId> <version>0.1.0-SNAPSHOT</version> - <name>tw.weekly.c133</name> - <description>Challenge #133</description> - <url>https://github.com/tw.weekly/tw.weekly.c133</url> + <name>tw.weekly.c134</name> + <description>Challenge #134</description> + <url>https://github.com/tw.weekly/tw.weekly.c134</url> <licenses> <license> <name>Eclipse Public License</name> diff --git a/challenge-134/tyler-wardhaugh/clojure/src/tw/weekly/c134/core.clj b/challenge-134/tyler-wardhaugh/clojure/src/tw/weekly/c134/core.clj new file mode 100644 index 0000000000..4f10a1dcc8 --- /dev/null +++ b/challenge-134/tyler-wardhaugh/clojure/src/tw/weekly/c134/core.clj @@ -0,0 +1,12 @@ +(ns tw.weekly.c134.core + (:require [tw.weekly.c134.t1 :as t1]) + (:require [tw.weekly.c134.t2 :as t2]) + (:gen-class)) + +(defn -main + "Run all tasks" + [& _] + (println "Task #1:") + (t1/-main) + (println "\nTask #2:") + (t2/-main)) diff --git a/challenge-134/tyler-wardhaugh/clojure/src/tw/weekly/c134/t1.clj b/challenge-134/tyler-wardhaugh/clojure/src/tw/weekly/c134/t1.clj new file mode 100644 index 0000000000..4ae7353a3c --- /dev/null +++ b/challenge-134/tyler-wardhaugh/clojure/src/tw/weekly/c134/t1.clj @@ -0,0 +1,14 @@ +(ns tw.weekly.c134.t1 + (:require [clojure.edn :as edn])) + +;;; +; Task description for TASK #1 › +;;; +(def DEFAULT-INPUT []) + +(defn -main + "Run Task 1 with a given input N, defaulting to the first example from the + task description." + [& args] + (let [[N] (or (some->> args (map edn/read-string)) DEFAULT-INPUT)] + )) diff --git a/challenge-134/tyler-wardhaugh/clojure/src/tw/weekly/c134/t2.clj b/challenge-134/tyler-wardhaugh/clojure/src/tw/weekly/c134/t2.clj new file mode 100644 index 0000000000..72aeb85a7f --- /dev/null +++ b/challenge-134/tyler-wardhaugh/clojure/src/tw/weekly/c134/t2.clj @@ -0,0 +1,14 @@ +(ns tw.weekly.c134.t2 + (:require [clojure.edn :as edn])) + +;;; +; Task description for TASK #2 › +;;; +(def DEFAULT-INPUT []) + +(defn -main + "Run Task 1 with a given input N, defaulting to the first example from the + task description." + [& args] + (let [[N] (or (some->> args (map edn/read-string)) DEFAULT-INPUT)] + )) diff --git a/challenge-134/tyler-wardhaugh/clojure/test/tw/weekly/c134/t1_test.clj b/challenge-134/tyler-wardhaugh/clojure/test/tw/weekly/c134/t1_test.clj new file mode 100644 index 0000000000..8f99c3f59a --- /dev/null +++ b/challenge-134/tyler-wardhaugh/clojure/test/tw/weekly/c134/t1_test.clj @@ -0,0 +1,3 @@ +(ns tw.weekly.c134.t1-test + (:require [clojure.test :refer [deftest is testing]] + [tw.weekly.c134.t1 :refer []])) diff --git a/challenge-134/tyler-wardhaugh/clojure/test/tw/weekly/c134/t2_test.clj b/challenge-134/tyler-wardhaugh/clojure/test/tw/weekly/c134/t2_test.clj new file mode 100644 index 0000000000..4ba20fcb26 --- /dev/null +++ b/challenge-134/tyler-wardhaugh/clojure/test/tw/weekly/c134/t2_test.clj @@ -0,0 +1,3 @@ +(ns tw.weekly.c134.t2-test + (:require [clojure.test :refer [deftest is testing]] + [tw.weekly.c134.t2 :refer []])) |
