diff options
Diffstat (limited to 'samples/aoc')
-rw-r--r-- | samples/aoc/2016/01/solve.bruijn | 2 | ||||
-rw-r--r-- | samples/aoc/2017/01/solve.bruijn | 2 | ||||
-rw-r--r-- | samples/aoc/2018/01/solve.bruijn | 2 | ||||
-rw-r--r-- | samples/aoc/2019/01/solve.bruijn | 2 | ||||
-rw-r--r-- | samples/aoc/2020/01/solve.bruijn | 2 | ||||
-rw-r--r-- | samples/aoc/2021/01/solve.bruijn | 2 | ||||
-rw-r--r-- | samples/aoc/2022/01/solve.bruijn | 2 | ||||
-rw-r--r-- | samples/aoc/2023/01/solve.bruijn | 2 |
8 files changed, 8 insertions, 8 deletions
diff --git a/samples/aoc/2016/01/solve.bruijn b/samples/aoc/2016/01/solve.bruijn index 525d311..efdaaaa 100644 --- a/samples/aoc/2016/01/solve.bruijn +++ b/samples/aoc/2016/01/solve.bruijn @@ -7,7 +7,7 @@ :import std/Number . :import std/List . -direction! [^0 : (S.number! ~0)] ⧗ (List Char) → Direction +direction! [^0 : (S.string→number ~0)] ⧗ (List Char) → Direction :test (direction! "R42") ('R' : (+42)) diff --git a/samples/aoc/2017/01/solve.bruijn b/samples/aoc/2017/01/solve.bruijn index dac0ed6..db29872 100644 --- a/samples/aoc/2017/01/solve.bruijn +++ b/samples/aoc/2017/01/solve.bruijn @@ -19,5 +19,5 @@ part2 [(sum ∘ eqs ∘ pairs) 0] :test (part1 ((+1) : ((+1) : ((+2) : {}(+2))))) ((+3)) main [parts nums] - nums C.number! <$> ^(lines 0) + nums C.char→number <$> ^(lines 0) parts [(part1 0) : (part2 0)] diff --git a/samples/aoc/2018/01/solve.bruijn b/samples/aoc/2018/01/solve.bruijn index cb47892..0fd0448 100644 --- a/samples/aoc/2018/01/solve.bruijn +++ b/samples/aoc/2018/01/solve.bruijn @@ -11,5 +11,5 @@ part2 z [[[[rec]]]] S.empty (+0) ⧗ (List FrequencyDiff) → Frequency case-end 1 main [parts nums] - nums signed-number! <$> (init (lines 0)) + nums string→signed-number <$> (init (lines 0)) parts [(part1 0) : (part2 (cycle 0))] diff --git a/samples/aoc/2019/01/solve.bruijn b/samples/aoc/2019/01/solve.bruijn index 518d198..3ec99ac 100644 --- a/samples/aoc/2019/01/solve.bruijn +++ b/samples/aoc/2019/01/solve.bruijn @@ -23,5 +23,5 @@ part1 ∑‣ ∘ (map fuel) ⧗ (List Mass) → Fuel part2 ∑‣ ∘ (map fuelfuel) ⧗ (List Mass) → Fuel main [parts nums] - nums number! <$> ~(<~>(lines 0)) + nums string→number <$> ~(<~>(lines 0)) parts [(part1 0) : (part2 0)] diff --git a/samples/aoc/2020/01/solve.bruijn b/samples/aoc/2020/01/solve.bruijn index 39bfcbc..7e4c0d2 100644 --- a/samples/aoc/2020/01/solve.bruijn +++ b/samples/aoc/2020/01/solve.bruijn @@ -18,5 +18,5 @@ part2 z [[rec]] case-cont 1 ~0 main [parts nums] - nums number! <$> ~(<~>(lines 0)) + nums string→number <$> ~(<~>(lines 0)) parts [(part1 (cross 0 0)) : (part2 (cross3 0 0 0))] diff --git a/samples/aoc/2021/01/solve.bruijn b/samples/aoc/2021/01/solve.bruijn index d48acff..1c14b3b 100644 --- a/samples/aoc/2021/01/solve.bruijn +++ b/samples/aoc/2021/01/solve.bruijn @@ -6,7 +6,7 @@ part1 [{ [[(1 <? 0) (+1) (+0)]] | 0 , ~0 }] part2 [{ [[(1 <? 0) (+1) (+0)]] | 0 , ~(~(~0)) }] main [parts nums] - nums number! <$> (lines 0) + nums string→number <$> (lines 0) parts [∑(part1 0) : ∑(part2 0)] # equivalent alternative using std/Pair P diff --git a/samples/aoc/2022/01/solve.bruijn b/samples/aoc/2022/01/solve.bruijn index 94b4cf7..7b2eaf6 100644 --- a/samples/aoc/2022/01/solve.bruijn +++ b/samples/aoc/2022/01/solve.bruijn @@ -2,7 +2,7 @@ :import std/String . main [answer] - numbers number! <$> (lines 0) + numbers string→number <$> (lines 0) parts split-list-by =?‣ numbers sums sum <$> parts answer build (sort-desc sums) diff --git a/samples/aoc/2023/01/solve.bruijn b/samples/aoc/2023/01/solve.bruijn index 5fdfa88..74361a2 100644 --- a/samples/aoc/2023/01/solve.bruijn +++ b/samples/aoc/2023/01/solve.bruijn @@ -2,6 +2,6 @@ :import std/String . :import std/Char C -part1 [[^0 ⋅ (+10) + _0] (filter (gre? (+9)) (C.number! <$> 0))] +part1 [[^0 ⋅ (+10) + _0] (filter (gre? (+9)) (C.char→number <$> 0))] main [∑(part1 <$> (lines 0))] |