Rule:Sand-Margolus

From LifeWiki
Revision as of 13:21, 8 December 2022 by Rowett (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
  1. A simple CA simulation of sand - inspired by MCell's version.

@RULE Sand-Margolus

@TABLE

n_states:4 neighborhood:Margolus symmetries:reflect_horizontal

  1. In the Margolus nhood, the transition a,b,c,d,e,f,g,h means:
  2. a b --> e f
  3. c d g h
  1. 0 : air
  2. 1 : sand
  3. 2 : wood
  4. 3 : magical source of sand

var a={0,1,2,3} var b={0,1,2,3}

1,1,0,0 : 0,0,1,1 # a pair of sand particles falls 1,a,0,b : 0,a,1,b # otherwise, sand falls next to a static column 1,0,a,0 : 0,0,a,1 # otherwise, it can topple 3,a,0,b : 3,a,1,b # sand can appear from the magical source