Skip to content

Commit 4f150ec

Browse files
committed
lint
1 parent 07e894b commit 4f150ec

File tree

8 files changed

+23
-28
lines changed

8 files changed

+23
-28
lines changed

2018/day16/day16.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
#!/usr/bin/env python3
22
# [Day 16: Chronal Classification](https://adventofcode.com/2018/day/16)
33

4-
from pathlib import Path
5-
from copy import deepcopy
6-
from collections import defaultdict, deque, namedtuple, Counter
7-
import sys, re, math, itertools, time
8-
from functools import reduce
9-
import re
10-
import unittest
4+
import sys
115
import typing as t
6+
from collections import defaultdict
7+
from copy import deepcopy
8+
from pathlib import Path
129

1310
OPCODES = (
1411
"addi",

2018/day8/day8.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
#!/usr/bin/env python3
22
# [Day 8: Memory Maneuver](https://adventofcode.com/2018/day/8)
33

4+
import sys
45
from pathlib import Path
5-
from copy import deepcopy
6-
from collections import defaultdict, deque, namedtuple, Counter
7-
import sys, re, math, itertools, time
8-
from functools import reduce
9-
import re
10-
import unittest
116

127
verbose = "-v" in sys.argv
138
if verbose:
@@ -54,7 +49,7 @@ def rec2(pos):
5449
value = 0
5550
for n in nodes[pos : pos + metadata]:
5651
if 0 < n <= len(values):
57-
value += values[n-1]
52+
value += values[n - 1]
5853

5954
pos += metadata
6055
return pos, value

2019/day20/day20.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
#!/usr/bin/env python3
22
# [Day 20: Donut Maze](https://adventofcode.com/2019/day/20)
33

4-
from pathlib import Path
5-
from copy import deepcopy
6-
from collections import defaultdict, deque, namedtuple, Counter
7-
import sys, re, math, itertools, time
8-
from functools import reduce
9-
import re
4+
import sys
105
import unittest
11-
from dataclasses import dataclass
12-
6+
from collections import defaultdict, deque
7+
from pathlib import Path
138

149
verbose = "-v" in sys.argv
1510
if verbose:

2022/day6/day6.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,14 @@
44

55
filename = ("test.txt" if sys.argv[1] == "-t" else sys.argv[1]) if len(sys.argv) > 1 else "input.txt"
66
data = open(filename).read()
7-
print("\n".join(map(str, list(min(i + length for i in range(len(data) - length) if len(set(data[i : i + length])) == length) for length in (4, 14)),)))
7+
print(
8+
"\n".join(
9+
map(
10+
str,
11+
list(
12+
min(i + length for i in range(len(data) - length) if len(set(data[i : i + length])) == length)
13+
for length in (4, 14)
14+
),
15+
)
16+
)
17+
)

2023/day24/day24.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
# [Day 24: Never Tell Me The Odds](https://adventofcode.com/2023/day/24)
33

44
import sys
5-
from collections import Counter, namedtuple
5+
from collections import namedtuple
66

77
# from fractions import Fraction
88
from pathlib import Path
99

1010
import sympy
1111

12-
1312
verbose = "-v" in sys.argv
1413
if verbose:
1514
sys.argv.remove("-v")

scripts/inputs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import tabulate
77

8-
98
RED = "\033[91m"
109
GREEN = "\033[92m"
1110
BLUE = "\033[94m"

scripts/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ networkx
22
sympy
33
curtsies
44
shapely
5+
tabulate

scripts/runall.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
import typing as t
1010
from collections import defaultdict
1111
from copy import deepcopy
12+
from datetime import timedelta
1213
from operator import itemgetter
1314
from pathlib import Path
1415
from zlib import crc32
15-
from datetime import timedelta
16-
1716

1817
RED = "\033[91m"
1918
GREEN = "\033[92m"

0 commit comments

Comments
 (0)