aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Wardhaugh <twardhaugh@cap-rx.com>2021-09-04 21:37:07 -0700
committerTyler Wardhaugh <twardhaugh@cap-rx.com>2021-09-05 12:52:14 -0700
commit94c38b608d8978e6add0b39857520aba562d8a85 (patch)
treeabf97b5c12b1be26f96889b04d8773f517a28291
parent903abdef122a8081f238f0b3a9e8c02c5929b2b8 (diff)
downloadperlweeklychallenge-club-94c38b608d8978e6add0b39857520aba562d8a85.tar.gz
perlweeklychallenge-club-94c38b608d8978e6add0b39857520aba562d8a85.tar.bz2
perlweeklychallenge-club-94c38b608d8978e6add0b39857520aba562d8a85.zip
Ch128 (Clojure): prep for challenge
-rw-r--r--challenge-128/tyler-wardhaugh/clojure/README.md14
-rw-r--r--challenge-128/tyler-wardhaugh/clojure/bb.edn4
-rw-r--r--challenge-128/tyler-wardhaugh/clojure/src/tw/weekly/c128/core.clj12
-rw-r--r--challenge-128/tyler-wardhaugh/clojure/test/tw/weekly/c128_test.clj12
4 files changed, 34 insertions, 8 deletions
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"
+ ))