diff options
9 files changed, 66 insertions, 14 deletions
diff --git a/challenge-140/tyler-wardhaugh/clojure/README.md b/challenge-140/tyler-wardhaugh/clojure/README.md index 17ac43fedd..213f1884bc 100644 --- a/challenge-140/tyler-wardhaugh/clojure/README.md +++ b/challenge-140/tyler-wardhaugh/clojure/README.md @@ -1,7 +1,7 @@ -# tw.weekly.c139 +# tw.weekly.c140 -The Weekly Challenge - #139 - Tyler Wardhaugh +The Weekly Challenge - #140 - 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.c139.core + $ clojure -M -m tw.weekly.c140.core # ... or ... $ bb run both @@ -21,15 +21,15 @@ Run the project's tests (which are samples from the task descriptions): Run Task #1 with input - $ clojure -M -m tw.weekly.c139.t1 COLL + $ clojure -M -m tw.weekly.c140.t1 A B # ... or ... - $ bb run task-1 COLL + $ bb run task-1 A B Run Task #2 with input: - $ clojure -M -m tw.weekly.c139.t2 + $ clojure -M -m tw.weekly.c140.t2 I J K # ... or ... - $ bb run task-2 + $ bb run task-2 I J K View available tasks Babashka can run: diff --git a/challenge-140/tyler-wardhaugh/clojure/bb.edn b/challenge-140/tyler-wardhaugh/clojure/bb.edn index ec79e59292..e053ec5de1 100644 --- a/challenge-140/tyler-wardhaugh/clojure/bb.edn +++ b/challenge-140/tyler-wardhaugh/clojure/bb.edn @@ -82,7 +82,7 @@ :task (run-task :t2 *command-line-args*)} task-2-bb {:doc "Run Task 2 (via Babashka)" - :task (bb-no-go :t2 *command-line-args*)} + :task (run-task-bb :t2 *command-line-args*)} both {:doc "Run both tasks (via clojure)" :task (do diff --git a/challenge-140/tyler-wardhaugh/clojure/deps.edn b/challenge-140/tyler-wardhaugh/clojure/deps.edn index 3386938e59..5b1400b27e 100644 --- a/challenge-140/tyler-wardhaugh/clojure/deps.edn +++ b/challenge-140/tyler-wardhaugh/clojure/deps.edn @@ -1,6 +1,5 @@ {:paths ["src" "resources"] - :deps {org.clojure/clojure {:mvn/version "1.10.3"} - com.hypirion/primes {:mvn/version "0.2.2"}} + :deps {org.clojure/clojure {:mvn/version "1.10.3"}} :aliases {:test {:extra-paths ["test"] :extra-deps {org.clojure/test.check {:mvn/version "1.1.0"} diff --git a/challenge-140/tyler-wardhaugh/clojure/pom.xml b/challenge-140/tyler-wardhaugh/clojure/pom.xml index 66472e6504..e51de32ab2 100644 --- a/challenge-140/tyler-wardhaugh/clojure/pom.xml +++ b/challenge-140/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.c139</artifactId> + <artifactId>tw.weekly.c140</artifactId> <version>0.1.0-SNAPSHOT</version> - <name>tw.weekly.c139</name> - <description>Challenge #139</description> - <url>https://github.com/tw.weekly/tw.weekly.c139</url> + <name>tw.weekly.c140</name> + <description>Challenge #140</description> + <url>https://github.com/tw.weekly/tw.weekly.c140</url> <licenses> <license> <name>Eclipse Public License</name> diff --git a/challenge-140/tyler-wardhaugh/clojure/src/tw/weekly/c140/core.clj b/challenge-140/tyler-wardhaugh/clojure/src/tw/weekly/c140/core.clj new file mode 100644 index 0000000000..7ac37537e6 --- /dev/null +++ b/challenge-140/tyler-wardhaugh/clojure/src/tw/weekly/c140/core.clj @@ -0,0 +1,12 @@ +(ns tw.weekly.c140.core + (:require [tw.weekly.c140.t1 :as t1]) + (:require [tw.weekly.c140.t2 :as t2]) + (:gen-class)) + +(defn -main + "Run all tasks" + [& _] + (println "Task #1:") + (t1/-main) + (println "\nTask #2:") + (t2/-main)) diff --git a/challenge-140/tyler-wardhaugh/clojure/src/tw/weekly/c140/t1.clj b/challenge-140/tyler-wardhaugh/clojure/src/tw/weekly/c140/t1.clj new file mode 100644 index 0000000000..7a33bbec1a --- /dev/null +++ b/challenge-140/tyler-wardhaugh/clojure/src/tw/weekly/c140/t1.clj @@ -0,0 +1,13 @@ +(ns tw.weekly.c140.t1) + +;;; +; Task description for TASK #1 › Add Binary +;;; +(def DEFAULT-INPUT [11 1]) + +(defn -main + "Run Task 1 with a given input A B, defaulting to the first example from the + task description." + [& args] + (let [[A B] (or args DEFAULT-INPUT)] + )) diff --git a/challenge-140/tyler-wardhaugh/clojure/src/tw/weekly/c140/t2.clj b/challenge-140/tyler-wardhaugh/clojure/src/tw/weekly/c140/t2.clj new file mode 100644 index 0000000000..d7507b7942 --- /dev/null +++ b/challenge-140/tyler-wardhaugh/clojure/src/tw/weekly/c140/t2.clj @@ -0,0 +1,14 @@ +(ns tw.weekly.c140.t2 + (:require [clojure.edn :as edn])) + +;;; +; Task description for TASK #2 › Multiplication Table +;;; +(def DEFAULT-INPUT [2 3 4]) + +(defn -main + "Run Task 2 with a given input I J K, defaulting to the first example from + the task description." + [& args] + (let [[I J K] (or (some->> args (map edn/read-string)) DEFAULT-INPUT)] + )) diff --git a/challenge-140/tyler-wardhaugh/clojure/test/tw/weekly/c140/t1_test.clj b/challenge-140/tyler-wardhaugh/clojure/test/tw/weekly/c140/t1_test.clj new file mode 100644 index 0000000000..037e36191e --- /dev/null +++ b/challenge-140/tyler-wardhaugh/clojure/test/tw/weekly/c140/t1_test.clj @@ -0,0 +1,7 @@ +(ns tw.weekly.c140.t1-test + (:require [clojure.test :refer [deftest is testing]] + [tw.weekly.c140.t1 :refer []])) + +(deftest examples + (testing "Examples from description" + )) diff --git a/challenge-140/tyler-wardhaugh/clojure/test/tw/weekly/c140/t2_test.clj b/challenge-140/tyler-wardhaugh/clojure/test/tw/weekly/c140/t2_test.clj new file mode 100644 index 0000000000..4e3fa291dc --- /dev/null +++ b/challenge-140/tyler-wardhaugh/clojure/test/tw/weekly/c140/t2_test.clj @@ -0,0 +1,7 @@ +(ns tw.weekly.c140.t2-test + (:require [clojure.test :refer [deftest is testing]] + [tw.weekly.c140.t2 :refer []])) + +(deftest examples + (testing "Examples from description" + )) |
