Skip to content

Instantly share code, notes, and snippets.

@Zimmux
Zimmux / solver.py
Last active July 1, 2019 14:29
gameaboutsquares solver
from collections import deque
class hashabledict(dict):
def __hash__(self):
return hash(tuple(sorted(self.items())))
def dictFromChar2D(c2d=[], filtr=lambda _:True):
return {
(x,y):c
for y,c1d in zip(range(len(c2d)),c2d)