Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
rene-d committed Feb 1, 2024
1 parent 07e894b commit 4f150ec
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 28 deletions.
11 changes: 4 additions & 7 deletions 2018/day16/day16.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#!/usr/bin/env python3
# [Day 16: Chronal Classification](https://adventofcode.com/2018/day/16)

from pathlib import Path
from copy import deepcopy
from collections import defaultdict, deque, namedtuple, Counter
import sys, re, math, itertools, time
from functools import reduce
import re
import unittest
import sys
import typing as t
from collections import defaultdict
from copy import deepcopy
from pathlib import Path

OPCODES = (
"addi",
Expand Down
9 changes: 2 additions & 7 deletions 2018/day8/day8.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
#!/usr/bin/env python3
# [Day 8: Memory Maneuver](https://adventofcode.com/2018/day/8)

import sys
from pathlib import Path
from copy import deepcopy
from collections import defaultdict, deque, namedtuple, Counter
import sys, re, math, itertools, time
from functools import reduce
import re
import unittest

verbose = "-v" in sys.argv
if verbose:
Expand Down Expand Up @@ -54,7 +49,7 @@ def rec2(pos):
value = 0
for n in nodes[pos : pos + metadata]:
if 0 < n <= len(values):
value += values[n-1]
value += values[n - 1]

pos += metadata
return pos, value
Expand Down
11 changes: 3 additions & 8 deletions 2019/day20/day20.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
#!/usr/bin/env python3
# [Day 20: Donut Maze](https://adventofcode.com/2019/day/20)

from pathlib import Path
from copy import deepcopy
from collections import defaultdict, deque, namedtuple, Counter
import sys, re, math, itertools, time
from functools import reduce
import re
import sys
import unittest
from dataclasses import dataclass

from collections import defaultdict, deque
from pathlib import Path

verbose = "-v" in sys.argv
if verbose:
Expand Down
12 changes: 11 additions & 1 deletion 2022/day6/day6.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,14 @@

filename = ("test.txt" if sys.argv[1] == "-t" else sys.argv[1]) if len(sys.argv) > 1 else "input.txt"
data = open(filename).read()
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)),)))
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)
),
)
)
)
3 changes: 1 addition & 2 deletions 2023/day24/day24.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
# [Day 24: Never Tell Me The Odds](https://adventofcode.com/2023/day/24)

import sys
from collections import Counter, namedtuple
from collections import namedtuple

# from fractions import Fraction
from pathlib import Path

import sympy


verbose = "-v" in sys.argv
if verbose:
sys.argv.remove("-v")
Expand Down
1 change: 0 additions & 1 deletion scripts/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import tabulate


RED = "\033[91m"
GREEN = "\033[92m"
BLUE = "\033[94m"
Expand Down
1 change: 1 addition & 0 deletions scripts/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ networkx
sympy
curtsies
shapely
tabulate
3 changes: 1 addition & 2 deletions scripts/runall.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
import typing as t
from collections import defaultdict
from copy import deepcopy
from datetime import timedelta
from operator import itemgetter
from pathlib import Path
from zlib import crc32
from datetime import timedelta


RED = "\033[91m"
GREEN = "\033[92m"
Expand Down

0 comments on commit 4f150ec

Please sign in to comment.