The proximity layer seems pretty easy to design, so I'll start with the other one.
Problem is, I'd like to get rid of wildcards in my patterns, to fall back to
Thue-like pattern declaration. In this system, you search for
substrings to replace, it's not an entire string-match. So something like
B ::= 1
actually really means
*B* ::= <star>1<star>
And I quite like it, because it's simple. Now here is the problem. If you don't have capturing wildcards, how would you declare a rule where some things should come from the north neighbor and some other from the east neighbor? With wildcards it's easy:
↑ foo #1 ↠bar #1 ::= got #1
There, if the north neighbor contains "foo baz" and the east neighbor contains "bar baz", then the calculated (central) cell will contain "got baz".
Something with common longest substring could be nice here.
Edit:
Ok, I got 1 solution, maybe not the nicest but it exists. Limit the number of directions to 1 per rule. It sounds more academic/serious.
↑ foo ::= bar
This would declare that if there's "foo" in one cell, then its south-neighbor will receive its content with "foo" replaced by "bar". Ordering of rules matter: for each cell, you start from the top rule and try each rule in order until you find one that fits, and you apply it.
Another idea could be to see each cell as a stack, where rule push strings... It would highly enhance the system, allowing for really more complex systems to be defined.
Edit:
Oh yeah, the directional layer pushes stuff on
stacks queues, and the proximity layers shifts stuff!!! YAAAA I'm crazy today.
Edit:
I'm so terribly angry. Hugely immensely angry.
The directional layer is more or less in a testable/implementable state, let's get to the proximity layer now. The proximity layer is supposed to count the number of matches in the neighborhood to fire a rule. Something like
3 foo ::= bar
that would mean "if there are 3 fooz in the neighborhood, then get the value and replace it with bar". Wait, which value? Same problem as earlier, can't choose between several neighbors.
Edit:
It's even more than that, since in typical 2D CA, you can have rules to create and rules to keep alive.
Breath.
Keeping it alive or creating it is not the problem, it's easy to count what's around. The real thing here is to choose the new value. We do have a possibility to get the value from the other layer, since we talked about queues, but I'd still like to be able to choose values from the neighborhood.
Anything selective could be used, like choosing the longest value in the neighborhood and applying the replacement. But the longest value doesn't seem to be necessarily the most relevant, so it's not a good idea.
Ooops, it's rising again.
Taking it from the other layer is cool, but there's a need to convey data the other way around, else it's useless. Let's look at the other layer again, see if we can get things back.
So what, just pushing it again on the queue? Feels weird. Also, this would mean we don't need the right hand side in the proximity layer rules anymore. Definitely weird. I don't like it.
It would be possible to only push a given value if rule fires. Like,
3 foo ::= bar
if there are 3 fooz, then this cell becomes "bar", and that's it. Simplistic.
Wait, if there are 3 fooz, then take a value from the other layer and replace foo by bar. Nope. Foo can't be both checked around and replaced by, doesn't make sense.
Trance is going on.
I don't feel stacks/queues are a good idea. For now I put it aside, I'll smoke it later. One value.