diff options
6 files changed, 62 insertions, 12 deletions
diff --git a/challenge-132/tyler-wardhaugh/clojure/README.md b/challenge-132/tyler-wardhaugh/clojure/README.md index 064e23e11f..74b8669aa3 100644 --- a/challenge-132/tyler-wardhaugh/clojure/README.md +++ b/challenge-132/tyler-wardhaugh/clojure/README.md @@ -1,7 +1,7 @@ -# tw.weekly.c130 +# tw.weekly.c132 -The Weekly Challenge - #130 - Tyler Wardhaugh +The Weekly Challenge - #132 - 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.c130.core + $ clojure -M -m tw.weekly.c132.core # ... or ... $ bb run both @@ -21,15 +21,13 @@ Run the project's tests (which are samples from the task descriptions): Run Task #1 with input - $ clojure -M -m tw.weekly.c130.t1 N - # ... or ... - $ bb run task-1 N + $ clojure -M -m tw.weekly.c132.t1 D Run Task #2 with input: - $ clojure -M -m tw.weekly.c130.t2 D S + $ clojure -M -m tw.weekly.c132.t2 H1 H2 I1 I2 # ... or ... - $ bb run task-2 D S + $ bb run task-2 H1 H2 I1 I2 View available tasks Babashka can run: diff --git a/challenge-132/tyler-wardhaugh/clojure/pom.xml b/challenge-132/tyler-wardhaugh/clojure/pom.xml index b1039ce744..b3edb199c9 100644 --- a/challenge-132/tyler-wardhaugh/clojure/pom.xml +++ b/challenge-132/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.c131</artifactId> + <artifactId>tw.weekly.c132</artifactId> <version>0.1.0-SNAPSHOT</version> - <name>tw.weekly.c131</name> - <description>Challenge #131</description> - <url>https://github.com/tw.weekly/tw.weekly.c131</url> + <name>tw.weekly.c132</name> + <description>Challenge #132</description> + <url>https://github.com/tw.weekly/tw.weekly.c132</url> <licenses> <license> <name>Eclipse Public License</name> diff --git a/challenge-132/tyler-wardhaugh/clojure/src/tw/weekly/c132/core.clj b/challenge-132/tyler-wardhaugh/clojure/src/tw/weekly/c132/core.clj new file mode 100644 index 0000000000..4115f99d9b --- /dev/null +++ b/challenge-132/tyler-wardhaugh/clojure/src/tw/weekly/c132/core.clj @@ -0,0 +1,12 @@ +(ns tw.weekly.c132.core + (:require [tw.weekly.c132.t1 :as t1]) + (:require [tw.weekly.c132.t2 :as t2]) + (:gen-class)) + +(defn -main + "Run all tasks" + [& _] + (println "Task #1:") + (t1/-main) + (println "\nTask #2:") + (t2/-main)) diff --git a/challenge-132/tyler-wardhaugh/clojure/src/tw/weekly/c132/t1.clj b/challenge-132/tyler-wardhaugh/clojure/src/tw/weekly/c132/t1.clj new file mode 100644 index 0000000000..007e4b2067 --- /dev/null +++ b/challenge-132/tyler-wardhaugh/clojure/src/tw/weekly/c132/t1.clj @@ -0,0 +1,14 @@ +(ns tw.weekly.c132.t1 + (:require [clojure.edn :as edn])) + +;;; +; Task description for TASK #1 › Mirror Dates +;;; +(def DEFAULT-INPUT []) + +(defn -main + "Run Task 1 with a given input N, defaulting to the first example from the + task description." + [& args] + (let [[D] (or args DEFAULT-INPUT)] + )) diff --git a/challenge-132/tyler-wardhaugh/clojure/src/tw/weekly/c132/t2.clj b/challenge-132/tyler-wardhaugh/clojure/src/tw/weekly/c132/t2.clj new file mode 100644 index 0000000000..8d237772b6 --- /dev/null +++ b/challenge-132/tyler-wardhaugh/clojure/src/tw/weekly/c132/t2.clj @@ -0,0 +1,14 @@ +(ns tw.weekly.c132.t2 + (:require [clojure.edn :as :edn)) + +;;; +; Task description for TASK #2, Hash Join +;;; +(def DEFAULT-INPUT []) + +(defn -main + "Run Task 1 with a given input D and S, defaulting to the first example from + the task description." + [& args] + (let [[H1 H2] (or (some->> args (map edn/read-string)) DEFAULT-INPUT)] + )) diff --git a/challenge-132/tyler-wardhaugh/clojure/test/tw/weekly/c132_test.clj b/challenge-132/tyler-wardhaugh/clojure/test/tw/weekly/c132_test.clj new file mode 100644 index 0000000000..e4ff9454a9 --- /dev/null +++ b/challenge-132/tyler-wardhaugh/clojure/test/tw/weekly/c132_test.clj @@ -0,0 +1,12 @@ +(ns tw.weekly.c132-test + (:require [clojure.test :refer [deftest is testing]] + #_[tw.weekly.c132.t1 :refer []] + #_[tw.weekly.c132.t2 :refer []])) + +(deftest task-1 + (testing "Task 1, Mirror Dates" + )) + +(deftest task-2 + (testing "Task 2, Hash Join" + )) |
