Skip to content

Commit a8973f5

Browse files
committed
Linting
1 parent 8960e6d commit a8973f5

File tree

14 files changed

+24
-32
lines changed

14 files changed

+24
-32
lines changed

input/2024/input15.nippy

12.7 KB
Binary file not shown.

src/advent_of_code_clj/y2020/d01.clj

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
(ns advent-of-code-clj.y2020.d01
2-
(:require [clojure.string :as str]))
1+
(ns advent-of-code-clj.y2020.d01)
32

43
(comment
54
(def liste-av-tall (map parse-long
@@ -35,4 +34,4 @@
3534
(first (for [x liste-av-tall
3635
y (drop 1 liste-av-tall)
3736
:when (= 2020 (+ x y))]
38-
(* x y))))
37+
(* x y))))

src/advent_of_code_clj/y2020/d03.clj

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
(ns advent-of-code-clj.y2020.d03
2-
(:require [clojure.string :as str]))
1+
(ns advent-of-code-clj.y2020.d03)
32

43
(def test-data "..##.........##.........##.........##.........##.........##....... --->
54
#...#...#..#...#...#..#...#...#..#...#...#..#...#...#..#...#...#..
@@ -33,4 +32,4 @@
3332
(x-til-høyre 3 kart)
3433
(x-til-høyre 5 kart)
3534
(x-til-høyre 7 kart)
36-
(x-til-høyre 1 (take-nth 2 kart)))))
35+
(x-til-høyre 1 (take-nth 2 kart)))))

src/advent_of_code_clj/y2020/d05.clj

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
(ns advent-of-code-clj.y2020.d05
2-
(:require [clojure.string :as str]
3-
[com.rpl.specter :refer :all #_[srange-dynamic subselect ALL FIRST select-one]]))
2+
(:require [com.rpl.specter :refer :all #_[srange-dynamic subselect ALL FIRST select-one]]))
43

54
(def test-data
65
[["BFFFBBFRRR" 70 7 567]
@@ -60,4 +59,4 @@
6059
(remove registrerte-sete-ider)
6160
(filter (fn [sete-id]
6261
(and (registrerte-sete-ider (inc sete-id))
63-
(registrerte-sete-ider (dec sete-id))))))))
62+
(registrerte-sete-ider (dec sete-id))))))))

src/advent_of_code_clj/y2020/d07.clj

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
(ns advent-of-code-clj.y2020.d07
22
(:require [clojure.string :as str]
3-
[meander.epsilon :as m]
4-
[meander.strategy.epsilon :as r]
53
[com.rpl.specter :as s]
64
[datascript.core :as d]
75
[clojure.walk :as walk]))
@@ -126,4 +124,4 @@ dotted black bags contain no other bags.")
126124
(remove (comp #{"shiny gold bag"} :bag)
127125
recursively-built-bags)))
128126
;;
129-
)
127+
)

src/advent_of_code_clj/y2021/d09_map.clj

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
(apply min (keep data (apply adjacent point))))))
2727
(r/fold (r/monoid merge hash-map) assoc)))
2828

29-
(r/fold (r/monoid merge hash-map) assoc (r/filter (fn [k v] (odd? v)) {[1 2] 1 :b 2 :c 3 :d 4}))
29+
(r/fold (r/monoid merge hash-map) assoc (r/filter (fn [_k v] (odd? v)) {[1 2] 1 :b 2 :c 3 :d 4}))
3030
(into [] (r/filter odd? [1 2 3 4]))
3131

3232
(defn higher-adjacent-points [data point]
@@ -87,4 +87,4 @@
8787
(sort >)
8888
(take 3)
8989
(apply *)
90-
(= 1168440))])))
90+
(= 1168440))])))

src/advent_of_code_clj/y2021/d13.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fold along x=5"))
3939
(defn fold [num at]
4040
(- at (Math/abs (- at num))))
4141

42-
(defn new-coords [coords [c n :as rule]]
42+
(defn new-coords [coords [c n :as _rule]]
4343
(set (map (fn [[x y]]
4444
(case c
4545
:y [x (fold y n)]

src/advent_of_code_clj/y2021/d16.clj

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ F = 1111")
9393
(true? x) 1
9494
:else x))
9595

96-
(defn calc [{:keys [op content] :as packet}]
96+
(defn calc [{:keys [op content] :as _packet}]
9797
(if (= identity op) content
9898
(apply (comp coerce-int op)
9999
(map calc content))))
@@ -114,4 +114,4 @@ F = 1111")
114114
;; Part 2
115115
(= 167737115857 (calc packet))
116116
;
117-
)
117+
)

src/advent_of_code_clj/y2021/d17.clj

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
(def test-data (parse "target area: x=20..30, y=-10..-5"))
88

9-
(defn distance-from-area? [[x y :as proj] [x1 x2 y1 y2 :as box]]
9+
(defn distance-from-area? [[x y :as _proj] [x1 x2 y1 y2 :as _box]]
1010
(if (and (>= x2 x x1)
1111
(>= y2 y y1))
1212
0
@@ -49,4 +49,4 @@
4949
(= 1070 (count (find-hits data)))
5050
(= 2701 (find-highest-y data))
5151
;
52-
)
52+
)

src/advent_of_code_clj/y2021/d18.clj

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
(ns advent-of-code-clj.y2021.d18
22
(:require [clojure.zip :as zip]
3-
[clojure.string :as str]
43
[clojure.walk :as walk]))
54

65
(defn apply-until [f pred z]
@@ -133,4 +132,4 @@
133132
(time (= 3756 (magnitude (reduce add data))))
134133
(time (= 4585 (max-magnitude data)))
135134
;;
136-
)
135+
)

src/advent_of_code_clj/y2021/d21.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Player 2 starting position: 8"))
5151
(defn play-game-2 [data nth-die]
5252
(reduce (fn [{:keys [die current-player] :as state} nth-die]
5353
(let [player-pos (modpos (+ (get state current-player)
54-
(+ die (to-num nth-die))))
54+
die (to-num nth-die)))
5555
new-state
5656
(-> state
5757
(assoc :die (+ 3 die))

src/y2022/d06.clj

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
(ns y2022.d06
22
(:require [tech.v3.datatype.argops :as da]
3-
[tech.v3.datatype.rolling :as dr]
4-
[criterium.core :as crit]))
3+
[tech.v3.datatype.rolling :as dr]))
54

65
(defn unique-sequence-end-index [length data]
76
(->> data
@@ -37,4 +36,4 @@
3736
(with-bindings {#'*unique-sequence-end-index-fn* unique-sequence-end-index-2}
3837
(= 3837 (part-2 (slurp "input/2022/06.txt")))))
3938
;; Execution time mean : 5,866074 ms
40-
)
39+
)

src/y2022/d19.clj

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
(ns y2022.d19
22
(:require [advent-of-code-clj.utils :refer [sum]]
3-
[clojure.string :as str])
4-
(:import (java.util ArrayDeque)))
3+
[clojure.string :as str]))
54

65
(def test-data "Blueprint 1: Each ore robot costs 4 ore. Each clay robot costs 2 ore. Each obsidian robot costs 3 ore and 14 clay. Each geode robot costs 2 ore and 7 obsidian.
76
Blueprint 2: Each ore robot costs 2 ore. Each clay robot costs 3 ore. Each obsidian robot costs 3 ore and 8 clay. Each geode robot costs 3 ore and 12 obsidian.")
@@ -27,15 +26,15 @@ Blueprint 2: Each ore robot costs 2 ore. Each clay robot costs 3 ore. Each obsid
2726
(map parse-blueprint (str/split-lines data)))
2827

2928
(defn build-ore-bot [{{ore-cost :ore} :ore-bot :keys [max-ore-cost]}
30-
[ore clay obsidian geode obot :as st]]
29+
[ore _clay _obsidian _geode obot :as st]]
3130
(when (and (> max-ore-cost obot)
3231
(>= ore ore-cost))
3332
(-> st
3433
(update 0 - ore-cost)
3534
(update 4 inc))))
3635

3736
(defn build-clay-bot [{{ore-cost :ore} :clay-bot :keys [max-clay-cost]}
38-
[ore clay obsidian geode obot cbot :as st]]
37+
[ore _clay _obsidian _geode _obot cbot :as st]]
3938
(when (and (> max-clay-cost cbot)
4039
(>= ore ore-cost))
4140
(-> st
@@ -53,15 +52,15 @@ Blueprint 2: Each ore robot costs 2 ore. Each clay robot costs 3 ore. Each obsid
5352
(update 6 inc))))
5453

5554
(defn build-geode-bot [{{ore-cost :ore obsidian-cost :obsidian} :geode-bot}
56-
[ore clay obsidian :as st]]
55+
[ore _clay obsidian :as st]]
5756
(when (and (>= ore ore-cost)
5857
(>= obsidian obsidian-cost))
5958
(-> st
6059
(update 0 - ore-cost)
6160
(update 2 - obsidian-cost)
6261
(update 7 inc))))
6362

64-
(defn heuristic [blueprint [ore clay obsidian geode orebot claybot obsidianbot geodebot]]
63+
(defn heuristic [blueprint [_ore _clay _obsidian _geode orebot claybot obsidianbot geodebot]]
6564
(float (+ geodebot
6665
(/ (+ geodebot
6766
(/ (+ (/ orebot (-> blueprint :geode-bot :ore))

src/y2022/d20.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@
6363
(part-1 (slurp "input/2022/20.txt"))
6464
(part-2 (slurp "input/2022/20.txt"))
6565
(with-bindings {#'*reorder-function* reorder-fast} (part-1 (slurp "input/2022/20.txt")))
66-
(with-bindings {#'*reorder-function* reorder-fast} (part-2 (slurp "input/2022/20.txt"))))
66+
(with-bindings {#'*reorder-function* reorder-fast} (part-2 (slurp "input/2022/20.txt"))))

0 commit comments

Comments
 (0)