aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormasikoijo <peytongoochtonic13@gmail.com>2025-11-11 01:58:41 -0500
committerGitHub <noreply@github.com>2025-11-11 01:58:41 -0500
commit2b8cb893c45a1fd65ad03b30babb25aae0506cc3 (patch)
tree3a48161e1eb2e08c6c2afa1d163c1ff9611747f4
parentde3c251353838331b46f957ef52be398086de189 (diff)
downloadperlweeklychallenge-club-2b8cb893c45a1fd65ad03b30babb25aae0506cc3.tar.gz
perlweeklychallenge-club-2b8cb893c45a1fd65ad03b30babb25aae0506cc3.tar.bz2
perlweeklychallenge-club-2b8cb893c45a1fd65ad03b30babb25aae0506cc3.zip
Upload week 347 solutions
-rw-r--r--challenge-347/beespider/ch-1.ua18
-rw-r--r--challenge-347/beespider/ch-2.ua17
2 files changed, 35 insertions, 0 deletions
diff --git a/challenge-347/beespider/ch-1.ua b/challenge-347/beespider/ch-1.ua
new file mode 100644
index 0000000000..f73fc627cf
--- /dev/null
+++ b/challenge-347/beespider/ch-1.ua
@@ -0,0 +1,18 @@
+# uiua 0.17.3
+
+FormatDate ← |1 (
+ °⊟₃⇌°/$"_ _"
+ ⊙(
+ ⊓(+₁⨂⍚↙₃Months|⋕◇↘₋₂)
+ ∩(⨬($"0_"|∘)⊸≥₁₀)
+ )
+ $"_-_-_"
+)
+
+┌─╴test
+ ⍤⤙≍ "2025-01-01" FormatDate "1st Jan 2025"
+ ⍤⤙≍ "2025-02-22" FormatDate "22nd Feb 2025"
+ ⍤⤙≍ "2025-04-15" FormatDate "15th Apr 2025"
+ ⍤⤙≍ "2025-10-23" FormatDate "23rd Oct 2025"
+ ⍤⤙≍ "2025-12-31" FormatDate "31st Dec 2025"
+└─╴
diff --git a/challenge-347/beespider/ch-2.ua b/challenge-347/beespider/ch-2.ua
new file mode 100644
index 0000000000..fdeb255b5f
--- /dev/null
+++ b/challenge-347/beespider/ch-2.ua
@@ -0,0 +1,17 @@
+# uiua 0.17.3
+
+FormatPhoneNumber ← |1 (
+ ▽⊸(¬∊"- ")
+ ⌈÷₃-₄⊸⧻
+ ⍥(⊙˜$"__-"⊃↘↙3) ⊙⊙""
+ ⨬∘($"_-_"⊃↙↘2) =₄⊸⧻
+ ˜⊂
+)
+
+┌─╴test
+ ⍤⤙≍ "123-456" FormatPhoneNumber "1-23-45-6"
+ ⍤⤙≍ "12-34" FormatPhoneNumber "1234"
+ ⍤⤙≍ "123-456-789" FormatPhoneNumber "12 345-6789"
+ ⍤⤙≍ "123-45-67" FormatPhoneNumber "123 4567"
+ ⍤⤙≍ "123-456-78" FormatPhoneNumber "123 456-78"
+└─╴