Cellular automata in GLSL+PyQT. Various rulesets can be found by checking out individual commits. http://hut.pm/cellmade_gallery.html
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
609 B

import collections
class OpenStruct(dict):
"""The fusion of dict and struct"""
def __init__(self, *args, **keywords):
dict.__init__(self, *args, **keywords)
self.__dict__ = self
class DefaultOpenStruct(collections.defaultdict):
"""The fusion of dict and struct, with default values"""
def __init__(self, *args, **keywords):
collections.defaultdict.__init__(self, None, *args, **keywords)
self.__dict__ = self
def __getattr__(self, name):
if name not in self.__dict__:
return None
return self.__dict__[name]