aboutsummaryrefslogtreecommitdiffhomepage
path: root/samples/aoc/2015
diff options
context:
space:
mode:
authorMarvin Borner2023-03-07 00:19:48 +0100
committerMarvin Borner2023-03-07 00:19:48 +0100
commit9ef10406c067d0a0532d609212a94519af402b87 (patch)
tree8d30448311ec43678873050ff7654d7f6c348ec8 /samples/aoc/2015
parent61b749cf19b30a307ef537f989e5509c3c4aa17f (diff)
Added a few advent of code solutions
Diffstat (limited to 'samples/aoc/2015')
-rw-r--r--samples/aoc/2015/01/input1
-rw-r--r--samples/aoc/2015/01/solve.bruijn10
2 files changed, 11 insertions, 0 deletions
diff --git a/samples/aoc/2015/01/input b/samples/aoc/2015/01/input
new file mode 100644
index 0000000..4b58722
--- /dev/null
+++ b/samples/aoc/2015/01/input
@@ -0,0 +1 @@
+()())
diff --git a/samples/aoc/2015/01/solve.bruijn b/samples/aoc/2015/01/solve.bruijn
new file mode 100644
index 0000000..da7c87d
--- /dev/null
+++ b/samples/aoc/2015/01/solve.bruijn
@@ -0,0 +1,10 @@
+:import std/List .
+:import std/Number .
+:import std/Char C
+
+walk scanl floor (+0)
+ floor [[(C.eq? 0 '(') ++1 --1]]
+
+main [parts (walk instructions)]
+ instructions init 0
+ parts [(last 0) : (find-index <?‣ 0)]