This file contains 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 | |
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): |
This file contains 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
1 | |
import copy | |
import itertools | |
import random | |
class GameOfLife(object): | |
def __init__(self, text): | |
start = [list(s) for s in text.splitlines()] |