aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-338/conor-hoekstra/ch-1.bqn13
-rw-r--r--challenge-338/conor-hoekstra/ch-2.bqn13
2 files changed, 26 insertions, 0 deletions
diff --git a/challenge-338/conor-hoekstra/ch-1.bqn b/challenge-338/conor-hoekstra/ch-1.bqn
new file mode 100644
index 0000000000..33ae645c08
--- /dev/null
+++ b/challenge-338/conor-hoekstra/ch-1.bqn
@@ -0,0 +1,13 @@
+# For up to date code:
+# https://github.com/codereport/bqn-code/blob/main/pwc/338-1.bqn
+
+u ⇐ •Import "/home/cph/bqn-test/test.bqn"
+
+HighestRow ← ⌈´+´˘
+
+# Tests
+u.UnitTest (HighestRow >⟨⟨4,4,4,4⟩,⟨10,0,0,0⟩,⟨2,2,2,9⟩⟩) ≡ 16
+u.UnitTest (HighestRow >⟨⟨1,5⟩,⟨7,3⟩,⟨3,5⟩⟩) ≡ 10
+u.UnitTest (HighestRow >⟨⟨1,2,3⟩,⟨3,2,1⟩⟩) ≡ 6
+u.UnitTest (HighestRow >⟨⟨2,8,7⟩,⟨7,1,3⟩,⟨1,9,5⟩⟩) ≡ 17
+u.UnitTest (HighestRow >⟨⟨10,20,30⟩,⟨5,5,5⟩,⟨0,100,0⟩,⟨25,25,25⟩⟩) ≡ 100
diff --git a/challenge-338/conor-hoekstra/ch-2.bqn b/challenge-338/conor-hoekstra/ch-2.bqn
new file mode 100644
index 0000000000..6cb4bff818
--- /dev/null
+++ b/challenge-338/conor-hoekstra/ch-2.bqn
@@ -0,0 +1,13 @@
+# For up to date code:
+# https://github.com/codereport/bqn-code/blob/main/pwc/338-2.bqn
+
+u ⇐ •Import "/home/cph/bqn-test/test.bqn"
+
+MaxDistance ← ⌈´·⥊·|-⌜
+
+# Tests
+u.UnitTest ( ⟨4,5,7⟩ MaxDistance ⟨9,1,3,4⟩) ≡ 6
+u.UnitTest ( ⟨2,3,5,4⟩ MaxDistance ⟨3,2,5,5,8,7⟩) ≡ 6
+u.UnitTest (⟨2,1,11,3⟩ MaxDistance ⟨2,5,10,2⟩) ≡ 9
+u.UnitTest ( ⟨1,2,3⟩ MaxDistance ⟨3,2,1⟩) ≡ 2
+u.UnitTest ( ⟨1,0,2,3⟩ MaxDistance ⟨5,0⟩) ≡ 5