Vlev2 wrote: April 27th, 2025, 4:32 pm
I am making my third ever multistate rule table using the von neumann neighborhood called Vlev2_Test_3
The rule is used to simulate sand and water physics.
but i ask a question.
how do i make it so water and sand moves orthogonally downward? [basically gravity]
and does it require extra cellstates above the water or sand?
That would depend on details (how you want it to work, interactions, etc. etc.)
but here is one possibility. This uses
because what you wrote so far only requires distinguishing "up" from "down". In general, if you want to do something more complicated (e.g. distinguishing "left" from "right"), you might need "symmetries:none". See this page for which symmetry types are supported:
https://github.com/GollyGang/ruletabler ... cd0f768208
Here is a demo. The .rule file content is appended after the pattern data; look for the header line "@RULE Testing210752" in the code snippet below.
Lines beginning with '#' are just comments, they don't affect how things work.
Code: Select all
#C [[ GRID ]]
x = 13, y = 22, rule = Testing210752
11.C2$10.C$11.C2$11.D$12.C$10.D$11.C2$10.CD2$11.CD$10.C$11.D$12.D4$.A
9.B$2.A9.B$3A7.3B!
@RULE Testing210752
See discussion around https://conwaylife.com/forums/viewtopic.php?p=210752#p210752
@NAMES
1 something
2 ground
3 sand
4 water
@TABLE
n_states:5
neighborhood:vonNeumann
symmetries:reflect_horizontal
var sand_or_water={3,4}
var x={0,1,2,3,4}
var x1=x
var x2=x
var x3=x
var x4=x
# The following rule says that, if there is empty space (cellstate 0)
# below a "sand" or "water" cell, then the cell will change to state 0:
sand_or_water, x1,x2, 0,x4, 0
# The following rule says that, in all other cases,
# a "sand" or "water" cell will remain unchanged:
sand_or_water, x1,x2,x3,x4, sand_or_water
# The following rule says that, if there is "sand" (cellstate 3) or "water" (cellstate 4)
# above an empty cell (cellstate 0), then the empty cell will change to the state
# of the cell above it:
0, sand_or_water,x2,x3,x4, sand_or_water
# The following rule says that a "ground" cell (cellstate 2)
# never changes no matter what:
2, x1,x2,x3,x4, 2
# The following rule says that,
# in all other conditions not covered by any of the preceding rules,
# every nonzero cell becomes zero, and every zero cell stays zero:
x, x1,x2,x3,x4, 0
A summary of the rules (extracted from the comments above):
- if there is empty space (cellstate 0) below a "sand" or "water" cell, then the cell will change to state 0
- in all other cases, a "sand" or "water" cell will remain unchanged
- if there is "sand" (cellstate 3) or "water" (cellstate 4) above an empty cell (cellstate 0), then the empty cell will change to the state of the cell above it
- a "ground" cell (cellstate 2) never changes no matter what
- in all other conditions not covered by any of the preceding rules, every nonzero cell becomes zero, and every zero cell stays zero