Skip to content

Commit

Permalink
rpi
Browse files Browse the repository at this point in the history
  • Loading branch information
wimglenn committed Dec 10, 2023
1 parent 50811c2 commit fdcfb09
Show file tree
Hide file tree
Showing 148 changed files with 281 additions and 119 deletions.
1 change: 1 addition & 0 deletions aoc_wim/aoc2015/q04.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
https://adventofcode.com/2015/day/4
"""
from _md5 import md5

from aocd import data


Expand Down
2 changes: 1 addition & 1 deletion aoc_wim/aoc2015/q07.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import operator
import re

from aocd import data
import numpy as np
from aocd import data


# TODO: change to use topological sort
Expand Down
1 change: 1 addition & 0 deletions aoc_wim/aoc2015/q17.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
https://adventofcode.com/2015/day/17
"""
from aocd import data

from aoc_wim.stuff import subset_sum

vals = [int(n) for n in data.splitlines()]
Expand Down
1 change: 1 addition & 0 deletions aoc_wim/aoc2015/q22.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""
from aocd import data
from fields import Fields

from aoc_wim.search import AStar


Expand Down
4 changes: 2 additions & 2 deletions aoc_wim/aoc2016/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import logging
from multiprocessing import current_process
import re
from _md5 import md5
from functools import partial
import re
from multiprocessing import current_process


log = logging.getLogger(__name__)
Expand Down
1 change: 1 addition & 0 deletions aoc_wim/aoc2016/q01.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
https://adventofcode.com/2016/day/1
"""
from aocd import data

from aoc_wim.zgrid import manhattan_distance


Expand Down
1 change: 1 addition & 0 deletions aoc_wim/aoc2016/q02.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
https://adventofcode.com/2016/day/2
"""
from aocd import data

from aoc_wim.zgrid import ZGrid


Expand Down
6 changes: 4 additions & 2 deletions aoc_wim/aoc2016/q05.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
--- Day 5: How About a Nice Game of Chess? ---
https://adventofcode.com/2016/day/5
"""
from aocd import data
import os
from collections import deque
from concurrent.futures import ProcessPoolExecutor
from aoc_wim.aoc2016 import md5_miner_q05
from itertools import count

from aocd import data

from aoc_wim.aoc2016 import md5_miner_q05


def main():
code1 = []
Expand Down
1 change: 1 addition & 0 deletions aoc_wim/aoc2016/q05_single_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
https://adventofcode.com/2016/day/5
"""
from _md5 import md5

from aocd import data


Expand Down
1 change: 1 addition & 0 deletions aoc_wim/aoc2016/q06.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
https://adventofcode.com/2016/day/6
"""
from collections import Counter

from aocd import data

counters = [Counter(x) for x in zip(*data.splitlines())]
Expand Down
1 change: 1 addition & 0 deletions aoc_wim/aoc2016/q08.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""
import numpy as np
from aocd import data

from aoc_wim.ocr import AOCR


Expand Down
4 changes: 2 additions & 2 deletions aoc_wim/aoc2016/q09.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
--- Day 9: Explosives in Cyberspace ---
https://adventofcode.com/2016/day/9
"""
from collections import deque
import re
import logging
import re
from collections import deque

from aocd import data

Expand Down
1 change: 1 addition & 0 deletions aoc_wim/aoc2016/q10.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
https://adventofcode.com/2016/day/10
"""
from math import prod

from aocd import data
from parse import parse

Expand Down
1 change: 1 addition & 0 deletions aoc_wim/aoc2016/q11.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from itertools import product

from aocd import data

from aoc_wim.search import AStar


Expand Down
1 change: 1 addition & 0 deletions aoc_wim/aoc2016/q12.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
https://adventofcode.com/2016/day/12
"""
from aocd import data

from aoc_wim.aoc2016 import AssembunnyComputer


Expand Down
6 changes: 4 additions & 2 deletions aoc_wim/aoc2016/q13.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
--- Day 13: A Maze of Twisty Little Cubicles ---
https://adventofcode.com/2016/day/13
"""
from aoc_wim.zgrid import ZGrid
from aocd import data
from functools import partial

from aocd import data

from aoc_wim.zgrid import ZGrid


def wall(z, fav_number):
if z.real < 0 or z.imag < 0:
Expand Down
6 changes: 4 additions & 2 deletions aoc_wim/aoc2016/q14.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
import re
from collections import defaultdict
from collections import deque
from concurrent.futures import ProcessPoolExecutor
from itertools import count

from aocd import data

from aoc_wim.aoc2016 import md5_miner_q14a
from aoc_wim.aoc2016 import md5_miner_q14b
from concurrent.futures import ProcessPoolExecutor
from itertools import count


def search(data, stretch):
Expand Down
3 changes: 2 additions & 1 deletion aoc_wim/aoc2016/q14_single_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
https://adventofcode.com/2016/day/14
"""
import re
from _md5 import md5
from collections import defaultdict

from aocd import data
from _md5 import md5


def search(data, stretch):
Expand Down
3 changes: 2 additions & 1 deletion aoc_wim/aoc2016/q17.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
--- Day 17: Two Steps Forward ---
https://adventofcode.com/2016/day/17
"""
from collections import deque
from _md5 import md5
from collections import deque

from aocd import data


Expand Down
1 change: 1 addition & 0 deletions aoc_wim/aoc2016/q23.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
https://adventofcode.com/2016/day/23
"""
from aocd import data

from aoc_wim.aoc2016 import AssembunnyComputer


Expand Down
4 changes: 3 additions & 1 deletion aoc_wim/aoc2016/q24.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
--- Day 24: Air Duct Spelunking ---
https://adventofcode.com/2016/day/24
"""
from aoc_wim.zgrid import ZGrid
from itertools import combinations
from itertools import permutations

import networkx as nx
from aocd import data

from aoc_wim.zgrid import ZGrid

grid = ZGrid(data, on=".", off="#")
graph = grid.graph(extra="0123456789")
distances = {}
Expand Down
1 change: 1 addition & 0 deletions aoc_wim/aoc2016/q25.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
https://adventofcode.com/2016/day/25
"""
import re

from aocd import data

x, y = re.findall(r"\d+", data)[:2]
Expand Down
1 change: 1 addition & 0 deletions aoc_wim/aoc2017/q03.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
https://adventofcode.com/2017/day/3
"""
from aocd import data

from aoc_wim.zgrid import manhattan_distance


Expand Down
3 changes: 2 additions & 1 deletion aoc_wim/aoc2017/q11.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
--- Day 11: Hex Ed ---
https://adventofcode.com/2017/day/11
"""
from aoc_wim import zgrid
from aocd import data

from aoc_wim import zgrid

z = d = dmax = 0
grid = zgrid.ZGrid({z: 1})
for step in data.split(","):
Expand Down
4 changes: 3 additions & 1 deletion aoc_wim/aoc2017/q18.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
--- Day 18: Duet ---
https://adventofcode.com/2017/day/18
"""
from aocd import data
from collections import deque

from aocd import data

from aoc_wim.aoc2017 import Comp

# import logging; logging.basicConfig(format="%(message)s", level=logging.DEBUG)
Expand Down
1 change: 1 addition & 0 deletions aoc_wim/aoc2017/q19.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
https://adventofcode.com/2017/day/19
"""
from aocd import data

from aoc_wim.zgrid import ZGrid


Expand Down
2 changes: 1 addition & 1 deletion aoc_wim/aoc2017/q20.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
https://adventofcode.com/2017/day/20
"""
from collections import defaultdict
from itertools import batched

from aocd import data
from parse import parse
from itertools import batched


def key(p):
Expand Down
1 change: 1 addition & 0 deletions aoc_wim/aoc2017/q23.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
https://adventofcode.com/2017/day/23
"""
from aocd import data

from aoc_wim.aoc2017 import Comp

# import logging; logging.basicConfig(format="%(message)s", level=logging.DEBUG)
Expand Down
1 change: 1 addition & 0 deletions aoc_wim/aoc2018/q06.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
https://adventofcode.com/2018/day/6
"""
from io import StringIO

import numpy as np
from aocd import data

Expand Down
2 changes: 2 additions & 0 deletions aoc_wim/aoc2018/q10.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
https://adventofcode.com/2018/day/10
"""
import re

import numpy as np
from aocd import data

from aoc_wim.ocr import AOCR
from aoc_wim.zgrid import ZGrid

Expand Down
1 change: 1 addition & 0 deletions aoc_wim/aoc2018/q18.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
https://adventofcode.com/2018/day/18
"""
import time

import numpy as np
from aocd import data
from scipy.signal import convolve2d
Expand Down
2 changes: 2 additions & 0 deletions aoc_wim/aoc2018/q19.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
https://adventofcode.com/2018/day/19
"""
import math

from aocd import data

from aoc_wim.aoc2018.q16 import all_ops


Expand Down
1 change: 1 addition & 0 deletions aoc_wim/aoc2018/q20.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""
import networkx as nx
from aocd import data

from aoc_wim.zgrid import manhattan_distance
from aoc_wim.zgrid import ZGrid

Expand Down
3 changes: 2 additions & 1 deletion aoc_wim/aoc2018/q22.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"""
from aocd import data
from parse import parse

from aoc_wim.search import AStar
from aoc_wim.zgrid import zrange
from aoc_wim.zgrid import manhattan_distance
from aoc_wim.zgrid import zrange


# TODO: use zgrid
Expand Down
2 changes: 1 addition & 1 deletion aoc_wim/aoc2018/q23.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
--- Day 23: Experimental Emergency Teleportation ---
https://adventofcode.com/2018/day/23
"""
import math
from heapq import heappop
from heapq import heappush
from itertools import product

import math
import numpy as np
from aocd import data
from parse import parse
Expand Down
1 change: 1 addition & 0 deletions aoc_wim/aoc2018/q25.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
https://adventofcode.com/2018/day/25
"""
from itertools import combinations

import networkx as nx
from aocd import data

Expand Down
2 changes: 1 addition & 1 deletion aoc_wim/aoc2019/q01.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
--- Day 1: The Tyranny of the Rocket Equation ---
https://adventofcode.com/2019/day/1
"""
from aocd import data
import numpy as np
from aocd import data


A = np.fromstring(data, dtype=int, sep="\n")
Expand Down
3 changes: 2 additions & 1 deletion aoc_wim/aoc2019/q02.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
--- Day 2: 1202 Program Alarm ---
https://adventofcode.com/2019/day/2
"""
from aoc_wim.aoc2019 import IntComputer
from aocd import data

from aoc_wim.aoc2019 import IntComputer


def part_a(data, r1=None, r2=None):
comp = IntComputer(data)
Expand Down
1 change: 1 addition & 0 deletions aoc_wim/aoc2019/q03.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
https://adventofcode.com/2019/day/3
"""
from aocd import data

from aoc_wim.zgrid import manhattan_distance
from aoc_wim.zgrid import ZGrid

Expand Down
Loading

0 comments on commit fdcfb09

Please sign in to comment.