This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import enum | |
from typing import Dict, Tuple | |
import aoc | |
import bytecode | |
def main(): | |
instrs = load_instructions() | |
w = World(instrs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List | |
import aoc | |
def read_layers(data: List[int], width: int, height: int): | |
size = width * height | |
for layer in range(len(data) // size): | |
yield Layer(data[size * layer:size * (layer + 1)], width, height) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import importlib | |
import sys | |
def open_input(name): | |
return open(f"input/{name}.txt") | |
def main(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
from typing import NamedTuple, List | |
import aoc | |
class Orbit(NamedTuple): | |
origin: str | |
name: str |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List | |
import aoc | |
P_MODE_POSITION = 0 | |
P_MODE_IMMEDIATE = 1 | |
class Opcodes(dict): | |
def __call__(self, code): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def NewType(name, base=object): | |
class _NewType(base): | |
pass | |
_NewType.__name__ = name | |
return _NewType |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aoc | |
from typing import NamedTuple | |
class Point(NamedTuple): | |
x: int | |
y: int | |
def up(self, distance): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import importlib | |
import sys | |
def open_input(name): | |
return open("inputs/" + name + ".txt") | |
def main(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3.7 | |
import json | |
import sys | |
from collections import defaultdict | |
import tsrg | |
mcpc_file = sys.argv[1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mnm.mods.tabbychat.util.config | |
import com.google.common.reflect.TypeToken | |
import kotlin.reflect.KProperty | |
sealed class AbstractValue<T> { | |
abstract val type: TypeToken<T>? | |
abstract val value: T | |
override fun toString(): String { |