Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168728
Image: ubuntu2004
load /home/jhyn/Bureau/Sage/CelAut.sage
h = CellularAutomaton1D(2,1,118)
h.print_local_rule()
There is 2 states and the rule acts on [-1,1]. '000' -> 0 '001' -> 1 '010' -> 1 '011' -> 0 '100' -> 1 '101' -> 1 '110' -> 1 '111' -> 0 This corresponds to the rule 118.
h.display("(011)^60 000 (011)60", width = 300, time = 200, torus = False)
g = cyclic_automaton(3)
g.display(random_conf((1,2,4),1000), width = 600, time = 200)
def f(a,b,c,d,e,f,g): def maj(a,b,c): if a==b or a==c: return a else: return b if d==0: return maj(a,c,d) else: return maj(d,e,g)
C = CellularAutomaton1D(2,3,f)
C.display(random_conf((1,1),2000),width=400, time=800,scale = 3)