I am making a cellular automaton secret message puzzle for my kids, and am looking for help on strategies to make it. I am relatively new to Mathematica, thank you for your help!
The puzzle is a grid of random letters with initial seed blocks and rule set. Once the full grid is filled out according to the rules, the last several clear blocks contain letters that spell out a "secret" message.
The following creates the random letters and output of the cellular automaton. What is a good approach for replacing N random letters at the bottom of the grid in the clear boxes with the message? I can imagine doing it by hand by editing the array of random letters, but would like a more general approach so I can make several puzzles.
width = 21;
height = 21;
randomLetters =
Graphics[{Black,
Table[Text[
ToUpperCase[FromLetterNumber[RandomInteger[{1, 26}]]], {n - 0.5,
m - 0.5}], {n, 1, width}, {m, 1, height}]}];
init = {1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1}; (* seed blocks *)
arrayPlot1 =
ArrayPlot[CellularAutomaton[182, init, 20],
Mesh -> True]; (* filled in puzzle *)
arrayPlot2 =
ArrayPlot[CellularAutomaton[0, init, 20],
Mesh -> True]; (* empty puzzle (using rule 0) showing just seed
blocks *)
Show[arrayPlot2, randomLetters]
RulePlot[CellularAutomaton[182]]
Show[arrayPlot1, randomLetters]
"Secret" message appears approximately within the rectangle above.