diff options
7 files changed, 66 insertions, 10 deletions
diff --git a/challenge-136/tyler-wardhaugh/clojure/README.md b/challenge-136/tyler-wardhaugh/clojure/README.md index 203cf79b7b..d05825bedb 100644 --- a/challenge-136/tyler-wardhaugh/clojure/README.md +++ b/challenge-136/tyler-wardhaugh/clojure/README.md @@ -1,7 +1,7 @@ -# tw.weekly.c135 +# tw.weekly.c136 -The Weekly Challenge - #135 - Tyler Wardhaugh +The Weekly Challenge - #136 - 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.c135.core + $ clojure -M -m tw.weekly.c136.core # ... or ... $ bb run both @@ -21,13 +21,15 @@ Run the project's tests (which are samples from the task descriptions): Run Task #1 with input - $ clojure -M -m tw.weekly.c135.t1 N + $ clojure -M -m tw.weekly.c136.t1 M N + # ... or ... + $ bb run task-1 M N Run Task #2 with input: - $ clojure -M -m tw.weekly.c135.t2 SEDOL + $ clojure -M -m tw.weekly.c136.t2 N # ... or ... - $ bb run task-2 SEDOL + $ bb run task-2 N View available tasks Babashka can run: diff --git a/challenge-136/tyler-wardhaugh/clojure/pom.xml b/challenge-136/tyler-wardhaugh/clojure/pom.xml index 4fb7c617a2..fbbe52d202 100644 --- a/challenge-136/tyler-wardhaugh/clojure/pom.xml +++ b/challenge-136/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.c135</artifactId> + <artifactId>tw.weekly.c136</artifactId> <version>0.1.0-SNAPSHOT</version> - <name>tw.weekly.c135</name> - <description>Challenge #135</description> - <url>https://github.com/tw.weekly/tw.weekly.c135</url> + <name>tw.weekly.c136</name> + <description>Challenge #136</description> + <url>https://github.com/tw.weekly/tw.weekly.c136</url> <licenses> <license> <name>Eclipse Public License</name> diff --git a/challenge-136/tyler-wardhaugh/clojure/src/tw/weekly/c136/core.clj b/challenge-136/tyler-wardhaugh/clojure/src/tw/weekly/c136/core.clj new file mode 100644 index 0000000000..4f1dcd8562 --- /dev/null +++ b/challenge-136/tyler-wardhaugh/clojure/src/tw/weekly/c136/core.clj @@ -0,0 +1,12 @@ +(ns tw.weekly.c136.core + (:require [tw.weekly.c136.t1 :as t1]) + (:require [tw.weekly.c136.t2 :as t2]) + (:gen-class)) + +(defn -main + "Run all tasks" + [& _] + (println "Task #1:") + (t1/-main) + (println "\nTask #2:") + (t2/-main)) diff --git a/challenge-136/tyler-wardhaugh/clojure/src/tw/weekly/c136/t1.clj b/challenge-136/tyler-wardhaugh/clojure/src/tw/weekly/c136/t1.clj new file mode 100644 index 0000000000..1dfc2ecfb5 --- /dev/null +++ b/challenge-136/tyler-wardhaugh/clojure/src/tw/weekly/c136/t1.clj @@ -0,0 +1,14 @@ +(ns tw.weekly.c136.t1 + (:require [clojure.edn :as edn])) + +;;; +; Task description for TASK #1 › Two Friendly +;;; +(def DEFAULT-INPUT [8 24]) + +(defn -main + "Run Task 1 with a given input M and N, defaulting to the first example from + the task description." + [& args] + (let [[M N] (or (some->> args (map edn/read-string)) DEFAULT-INPUT)] + )) diff --git a/challenge-136/tyler-wardhaugh/clojure/src/tw/weekly/c136/t2.clj b/challenge-136/tyler-wardhaugh/clojure/src/tw/weekly/c136/t2.clj new file mode 100644 index 0000000000..7a1d1edc68 --- /dev/null +++ b/challenge-136/tyler-wardhaugh/clojure/src/tw/weekly/c136/t2.clj @@ -0,0 +1,14 @@ +(ns tw.weekly.c136.t2 + (:require [clojure.edn :as edn])) + +;;; +; Task description for TASK #2 › Fibonacci Sequence +;;; +(def DEFAULT-INPUT [16]) + +(defn -main + "Run Task 2 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-136/tyler-wardhaugh/clojure/test/tw/weekly/c136/t1_test.clj b/challenge-136/tyler-wardhaugh/clojure/test/tw/weekly/c136/t1_test.clj new file mode 100644 index 0000000000..c223c2e4fa --- /dev/null +++ b/challenge-136/tyler-wardhaugh/clojure/test/tw/weekly/c136/t1_test.clj @@ -0,0 +1,7 @@ +(ns tw.weekly.c136.t1-test + (:require [clojure.test :refer [deftest is testing]] + [tw.weekly.c136.t1 :refer []])) + +(deftest examples + (testing "Examples from description" + )) diff --git a/challenge-136/tyler-wardhaugh/clojure/test/tw/weekly/c136/t2_test.clj b/challenge-136/tyler-wardhaugh/clojure/test/tw/weekly/c136/t2_test.clj new file mode 100644 index 0000000000..71d89fe440 --- /dev/null +++ b/challenge-136/tyler-wardhaugh/clojure/test/tw/weekly/c136/t2_test.clj @@ -0,0 +1,7 @@ +(ns tw.weekly.c136.t2-test + (:require [clojure.test :refer [deftest is testing]] + [tw.weekly.c136.t2 :refer []])) + +(deftest examples + (testing "Examples from description" + )) |
