From 94c38b608d8978e6add0b39857520aba562d8a85 Mon Sep 17 00:00:00 2001 From: Tyler Wardhaugh Date: Sat, 4 Sep 2021 21:37:07 -0700 Subject: Ch128 (Clojure): prep for challenge --- challenge-128/tyler-wardhaugh/clojure/README.md | 14 +++++++------- challenge-128/tyler-wardhaugh/clojure/bb.edn | 4 +++- .../tyler-wardhaugh/clojure/src/tw/weekly/c128/core.clj | 12 ++++++++++++ .../tyler-wardhaugh/clojure/test/tw/weekly/c128_test.clj | 12 ++++++++++++ 4 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 challenge-128/tyler-wardhaugh/clojure/src/tw/weekly/c128/core.clj create mode 100644 challenge-128/tyler-wardhaugh/clojure/test/tw/weekly/c128_test.clj diff --git a/challenge-128/tyler-wardhaugh/clojure/README.md b/challenge-128/tyler-wardhaugh/clojure/README.md index e040ae4a94..36e0cd8bb2 100644 --- a/challenge-128/tyler-wardhaugh/clojure/README.md +++ b/challenge-128/tyler-wardhaugh/clojure/README.md @@ -1,7 +1,7 @@ -# tw.weekly.c127 +# tw.weekly.c128 -The Weekly Challenge - #127 - Tyler Wardhaugh +The Weekly Challenge - #128 - 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.c127.core + $ clojure -M -m tw.weekly.c128.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.c127.t1 S1 S2 + $ clojure -M -m tw.weekly.c128.t1 M # ... or ... - $ bb run task-1 S1 S2 + $ bb run task-1 M Run Task #2 with input: - $ clojure -M -m tw.weekly.c127.t2 I + $ clojure -M -m tw.weekly.c128.t2 A D # ... or ... - $ bb run task-2 I + $ bb run task-2 A D View available tasks Babashka can run: diff --git a/challenge-128/tyler-wardhaugh/clojure/bb.edn b/challenge-128/tyler-wardhaugh/clojure/bb.edn index 4cd11817b8..70feb7d8ea 100644 --- a/challenge-128/tyler-wardhaugh/clojure/bb.edn +++ b/challenge-128/tyler-wardhaugh/clojure/bb.edn @@ -63,7 +63,9 @@ :task (run-task :t1 *command-line-args*)} task-1-bb {:doc "Run Task 1 (via Babashka)" - :task (run-task-bb :t1 *command-line-args*)} + :task (binding [*out* *err*] + (println "error: can't run Task 1 via Babashka because it depends on some incompatible libraries.") + (System/exit 1))} task-2 {:doc "Run Task 2 (via clojure)" :task (run-task :t2 *command-line-args*)} diff --git a/challenge-128/tyler-wardhaugh/clojure/src/tw/weekly/c128/core.clj b/challenge-128/tyler-wardhaugh/clojure/src/tw/weekly/c128/core.clj new file mode 100644 index 0000000000..3b6fa41737 --- /dev/null +++ b/challenge-128/tyler-wardhaugh/clojure/src/tw/weekly/c128/core.clj @@ -0,0 +1,12 @@ +(ns tw.weekly.c128.core + (:require [tw.weekly.c128.t1 :as t1]) + (:require [tw.weekly.c128.t2 :as t2]) + (:gen-class)) + +(defn -main + "Run all tasks" + [& _] + (println "Task #1:") + (t1/-main) + (println "\nTask #2:") + (t2/-main)) diff --git a/challenge-128/tyler-wardhaugh/clojure/test/tw/weekly/c128_test.clj b/challenge-128/tyler-wardhaugh/clojure/test/tw/weekly/c128_test.clj new file mode 100644 index 0000000000..f89be58ecd --- /dev/null +++ b/challenge-128/tyler-wardhaugh/clojure/test/tw/weekly/c128_test.clj @@ -0,0 +1,12 @@ +(ns tw.weekly.c128-test + (:require [clojure.test :refer [deftest is testing]] + #_[tw.weekly.c128.t1 :refer []] + #_[tw.weekly.c128.t2 :as t2])) + +(deftest task-1 + (testing "Task 1, Maximum Sub-Matrix" + )) + +(deftest task-2 + (testing "Task 2, Minimum Platforms" + )) -- cgit