Thank you for this.
After rotating the tiling to assign the vertical "time" direction, we
define the rows to be the sets of polygons with centers at equivalent
y-coordinates?
That's awesome! And the neighborhoods of each cell include cells in its Moore neighborhood with higher y-coordinates.
It's so cool how the rules you only need to change a few of the parameters, the symmetric and self-similar "nesting" structure it generates, and the rules 30 & 90 single cell seed type 1. When extending the definition to other tilings, like the rotated square tiling it is so asymmetric and we can generate vertically asymmetric rotated square tilings for Rule 30 and mysterious fractal structures within Rule 90.
What is your favorite instance for which the rules are "dual" to each other via random initial conditions, since each rule corresponds to one of the 16 binary logical connectives with two inputs. What a treat!
w = 25; h = 30;
arrs = (ReplacePart[
Table[Table[0, {j, 1, h}, {i, 1, w}], {n, 1, 16}][[#]],
1 -> {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1}]) & /@ Range[16];
correctVec[{x_, y_}] := {1 + Mod[-1 + 9 w + x, w],
1 + Mod[-1 + 9 h + y, h]}
neighborsVal[x_, y_,
arr_] := (arr[[#[[2]]]][[#[[1]]]]) & /@ (correctVec[{x,
y} + #] & /@ {{0, -1}, {1, -1}});
Table[Table[
newArr = Table[
Replace[neighborsVal[i,
iterN,
arrs[[n]]],
Dispatch[Table[
Table[{Mod[d, 2],
Mod[Floor[d/2], 2]} -> Mod[Floor[(n - 1)/(2^(d))], 2],
{d, 0, 3}],
{n, 1, 16}
]][[n]]],
{i, 1, w}
];
arrs[[n]] = ReplacePart[arrs[[n]], iterN -> newArr], {iterN, 2,
h}], {n, 1, 16}];
pic[n_] := (
theSideLength = 1;
theHexRadius = (theSideLength/2)/Sin[2 \[Pi]/(6*2)];
theHexApothem = (theSideLength/2)/Tan[2 \[Pi]/(6*2)];
g =
Flatten@
Table[{If[arrs[[n]][[j]][[i]] > 0, RGBColor[100, 71, 0, 66], Cyan],
RegularPolygon[{
-(w)*theHexApothem + (Mod[i + j/2, w])*theHexApothem*2,
-j*(theSideLength -
Sqrt[theSideLength^2 - theHexApothem^2])*3
}, {theHexRadius, Pi/6}, 6]
}, {j, 1, h}, {i, 1, w}];
Column[{Graphics[g,
PlotRange -> {{-25, 25}, {2, -50}},
Frame -> True,
ImageSize -> Automatic],
{"False", "NOR", "a AND not b", "NOT b", "not a AND b", "NOT a",
"XOR", "NAND", "AND", "XNOR", "a", "a OR not b", "b",
"not a OR b", "OR", "True"}[[n]]}]
)
pic /@ Range[1, 16]
How do you describe the neighborhoods in the two triangle tilings that are not identical, given that both triangle tiling orientations have 5 neighbors looking up, and these rules are dual to each other?
It's pretty clear that / @ the function pic to ranges of numbers representing the bitwise operators draws one unit side lengths with the radius and its tangent apothem. When generating these graphs, remember that if gives t if condition evaluates to True, and f if it evaluates to False, like a ternary (reference.wolfram.com). If you're generating a regular polygon in Wolfram Mathematica, with the help of some curly braces we can highlight the values we are looking for, getting arrays of 16 tables (for each) rule, height first and width 25. It's not like we were going to look at the evaluation display so the semicolon within the function block shows us the linted completion of ReplacePart (and if statements, what are semi-colons and if statements for besides executing multiple lines of evaluation without display?), unless we're outside the function.
Aside from the use of curly braces as parameterized request bodies, we tried ArrayPlot already and it was beautiful... making these graphs is so frustrating because we are implicitly representing arguments to pure functions, the correct vector functions are your vector functions, @Chase Marangu because they can be merged into one based on what they do, and they can be re-assigned to extend our vertical framework for finding neighbors' coordinates down the y-axis.
Generating cellular automata is nice, just look at the array index's correspondence with the x, y coordinate axes! What is some good code to test the neighborsVal function before we generate an optimized dispatch table representation of the rules? Now, generate a length 16 array of 30 by 25.
How do you draw the RegularPolygon equation? Is it sufficient to say that 2*pi is the geometric hexagonal shape with side length 1 so that we can look at the angle between the hexagon radius and the hexagon apothem... @Chase Marangu we can make rules like makeRule[x_Integer] := Table[Mod[Floor[x/(2^(3 - n))], 2], {n, 0, 3}];
.