Skip to content

Instantly share code, notes, and snippets.

from dataclasses import dataclass
from pprint import pprint
from typing import List
import networkx as nx
import pandas as pd
import plac
import pywikibot
import requests
from pyvis.network import Network
@BLannoo
BLannoo / functional-implementation-game-of-life.py
Last active September 26, 2022 18:20
functional-implementation-game-of-life
import unittest
from typing import Tuple, Set, Callable
Location = Tuple[int, int]
Universe = Set[Location]
def tick(old_universe: Universe) -> Universe:
new_universe = apply_rules(old_universe)
return {
@BLannoo
BLannoo / GameOfLife.py
Last active June 25, 2019 17:23
GameOfLife_FullImplementation
import unittest
class Universe:
def __init__(self, livingCells):
self.livingCells = livingCells
def tick(self):
stayed_alive = {
@BLannoo
BLannoo / test.py
Created June 25, 2019 15:08
GameOfLifeKata_InPython_BlinkerTestNotImplementedYet
import unittest
class Universe:
def __init__(self, livingCells):
self.livingCells = livingCells
def tick(self):
self.livingCells = {