I think it's possible to just define a class called Rule that takes in a rulestring and has classmethods that returns a callable. A sample usage may be the following:
import seagull as sg
rule = sg.Rule(B=3, S=[2,3]) # Simulates Conway's rule
rule.apply # A callable that you apply to the board
Thus, the implementation of sg.rules.conway_classic may be as simple as returning the apply method.
I think it's possible to just define a class called
Rule
that takes in a rulestring and hasclassmethods
that returns a callable. A sample usage may be the following:Thus, the implementation of
sg.rules.conway_classic
may be as simple as returning theapply
method.