about summary refs log tree commit diff
path: root/users/sterni/exercises/aoc/lib.bqn
diff options
context:
space:
mode:
Diffstat (limited to 'users/sterni/exercises/aoc/lib.bqn')
-rw-r--r--users/sterni/exercises/aoc/lib.bqn8
1 files changed, 8 insertions, 0 deletions
diff --git a/users/sterni/exercises/aoc/lib.bqn b/users/sterni/exercises/aoc/lib.bqn
new file mode 100644
index 000000000000..025102b7760b
--- /dev/null
+++ b/users/sterni/exercises/aoc/lib.bqn
@@ -0,0 +1,8 @@
+IsAsciiNum ⇐ ('0'⊸≤∧≤⟜'9')
+
+ReadInt ⇐ {(𝕨⊸×+⊣)´∘⌽-⟜'0'𝕩} # stolen from leah2
+ReadDec ⇐ 10⊸ReadInt
+
+SplitOn ⇐ ((⊢ (-1˙)⍟⊣¨ +`∘(1⊸»<⊢))∘(≡¨)⊔⊢)
+
+_fix ⇐ {𝕩 𝕊∘⊢⍟≢ 𝔽 𝕩}