Skip to content

Instantly share code, notes, and snippets.

@GlenboLake
GlenboLake / day20_math.py
Created December 20, 2017 20:11
Day 20 of Advent of Code 2017, solved without iteration
import re
from cmath import sqrt
from collections import defaultdict, namedtuple
from functools import reduce
from itertools import combinations
from time import time
Particle = namedtuple('Particle', ['pos', 'vel', 'acc'])
def parse_particle(line):
@GlenboLake
GlenboLake / gol.txt
Last active September 23, 2015 20:48
Output of /r/dailyprogrammer challenge 233 Intermediate
1
import copy
import itertools
import random
class GameOfLife(object):
def __init__(self, text):
start = [list(s) for s in text.splitlines()]