## Universal construction of complex patterns from 1 cell

For discussion of other cellular automata.

### Universal construction of complex patterns from 1 cell

There are a lot of RuleLoader rules (proof somewhere here). If we take the binary logarithm of the amount of rules, we can basically conclude, though simplified, that we can encode 4 billion terabytes of information in one rule. We can thus have a significant ROM built into the ruletable itself.

Say you have a cell, O (for origin), which is a cell of state 1 surrounded by state 0. Counter cells then appear around the cell, which then count up through all their possible combinations, thus meaning that O is exposed to countless neighbourhood conditions. Each condition could make O take a certain state, which would have the effect of reading a ROM to the outside world.

As such, it is possible to build a 1-cell constructor for basically any arbitrary pattern. Here's one I prepared earlier (this is a rule):
monalisa.txt.zip

Run it with this pattern:
`x = 1, y = 1, rule = BLAHMONALISAA!`

Does anyone find this idea interesting or useful? I don't know if it really has any significant implications; I guess it might be nice as an example pattern in Golly, though there is plenty of room for optimisation, including an idea I had that would probably make it twice as fast. Also, please tell me if this idea has been discussed before.
succ

blah

Posts: 221
Joined: April 9th, 2016, 7:22 pm

### Re: Universal construction of complex patterns from 1 cell

I have been thinking about this since starting to learn RuleLoader, but as the person that I am, I'm too lazy to make these

Do you have a script or something to make these?
Proud owner and founder of Sakagolue
`x = 17, y = 10, rule = B3/S23b2ob2obo5b2o\$11b4obo\$2bob3o2bo2b3o\$bo3b2o4b2o\$o2bo2bob2o3b4o\$bob2obo5bo2b2o\$2b2o4bobo2b3o\$bo3b5ob2obobo\$2bo5bob2o\$4bob2o2bobobo!`

(Check gen 2)

Saka

Posts: 2479
Joined: June 19th, 2015, 8:50 pm
Location: In the kingdom of Sultan Hamengkubuwono X

### Re: Universal construction of complex patterns from 1 cell

Saka wrote:I have been thinking about this since starting to learn RuleLoader, but as the person that I am, I'm too lazy to make these

So you came up with the idea of generating complex patterns from a single cell using counters, or are you speaking more generally?
Saka wrote:Do you have a script or something to make these?

I wrote a program in C++ to take an XPM and convert it to a set of transitions, and prepend the rule file itself to it, thus generating the version of the rule with the ROM of the picture built into it.
succ

blah

Posts: 221
Joined: April 9th, 2016, 7:22 pm

### Re: Universal construction of complex patterns from 1 cell

blah wrote:
Saka wrote:I have been thinking about this since starting to learn RuleLoader, but as the person that I am, I'm too lazy to make these

So you came up with the idea of generating complex patterns from a single cell using counters, or are you speaking more generally?

I was thinking of generating a painting with cell-specific instructions and stuff, starting from 1 cell.
blah wrote:
Saka wrote:Do you have a script or something to make these?

I wrote a program in C++ to take an XPM and convert it to a set of transitions, and prepend the rule file itself to it, thus generating the version of the rule with the ROM of the picture built into it.

Proud owner and founder of Sakagolue
`x = 17, y = 10, rule = B3/S23b2ob2obo5b2o\$11b4obo\$2bob3o2bo2b3o\$bo3b2o4b2o\$o2bo2bob2o3b4o\$bob2obo5bo2b2o\$2b2o4bobo2b3o\$bo3b5ob2obobo\$2bo5bob2o\$4bob2o2bobobo!`

(Check gen 2)

Saka

Posts: 2479
Joined: June 19th, 2015, 8:50 pm
Location: In the kingdom of Sultan Hamengkubuwono X

### Re: Universal construction of complex patterns from 1 cell

Sadly, it requires quite a bit of minimal configuration and tweaking, and it would take a while to explain, so I might as well spend that effort writing a program which is simpler to use rather than explaining how to use the hacked-together .c++ file that I wrote over the course of ~5 hours. Plus, unless you want to make a two-colour image, you'd have to manually write all the colours down; that's what I did with the mona lisa.

Saka wrote:I was thinking of generating a painting with cell-specific instructions and stuff, starting from 1 cell.

How detailed was that idea? Did you image it having a stationary core that all the signals came out of, like my implementation?
succ

blah

Posts: 221
Joined: April 9th, 2016, 7:22 pm

### Re: Universal construction of complex patterns from 1 cell

blah wrote:

Sadly, it requires quite a bit of minimal configuration and tweaking, and it would take a while to explain, so I might as well spend that effort writing a program which is simpler to use rather than explaining how to use the hacked-together .c++ file that I wrote over the course of ~5 hours. Plus, unless you want to make a two-colour image, you'd have to manually write all the colours down; that's what I did with the mona lisa.

What a shame (No sarcasm)
blah wrote:
Saka wrote:I was thinking of generating a painting with cell-specific instructions and stuff, starting from 1 cell.

How detailed was that idea? Did you image it having a stationary core that all the signals came out of, like my implementation?

Just finished writing a very simple implementation of it:
`@RULE SAKASMILEY#State 1 is the drawing state, so do state 2@TABLEn_states:14neighborhood:vonNeumannsymmetries:none#State 22,0,0,0,0,10,0,0,0,2,3#State 30,0,0,0,3,43,0,0,0,1,0#State 40,0,0,0,4,54,0,0,0,0,0#State 55,0,0,0,0,10,5,0,0,0,6#State 66,1,0,0,0,00,6,0,0,0,7#State 77,0,0,0,0,10,0,7,0,0,8#State 88,0,1,0,0,00,0,8,0,0,9#State 99,0,0,0,0,00,0,9,0,0,10#State 1010,0,0,0,0,10,10,0,0,0,11#State 1111,1,0,0,0,00,0,0,0,11,12#State 1212,0,0,0,0,10,0,0,0,12,13#State 1313,0,0,0,1,1`

This:
`x = 1, y = 1, rule = SAKASMILEYB!`
Proud owner and founder of Sakagolue
`x = 17, y = 10, rule = B3/S23b2ob2obo5b2o\$11b4obo\$2bob3o2bo2b3o\$bo3b2o4b2o\$o2bo2bob2o3b4o\$bob2obo5bo2b2o\$2b2o4bobo2b3o\$bo3b5ob2obobo\$2bo5bob2o\$4bob2o2bobobo!`

(Check gen 2)

Saka

Posts: 2479
Joined: June 19th, 2015, 8:50 pm
Location: In the kingdom of Sultan Hamengkubuwono X

### Re: Universal construction of complex patterns from 1 cell

Could a concept similar to this be used to make a 1-cell spaceship of any speed up to (m,n)c/256, assuming said speed is possible in the given neighbourhood?
2c/n spaceships project

Current priorities: see here
muzik

Posts: 2724
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

### Re: Universal construction of complex patterns from 1 cell

muzik wrote:Could a concept similar to this be used to make a 1-cell spaceship of any speed up to (m,n)c/256, assuming said speed is possible in the given neighbourhood?

It would be relatively simple to make a rule which allows (m,n)c/p spaceships for allowable values of m,n, and p, but what do you mean "up to (m,n)c/256"? Why would 2^8 be the limit?
succ

blah

Posts: 221
Joined: April 9th, 2016, 7:22 pm

### Re: Universal construction of complex patterns from 1 cell

Well, that would be the limit were the ship to stay as a single cell forever. If that wasn't the case, i'm pretty sure the range of speeds would be a lot higher.
2c/n spaceships project

Current priorities: see here
muzik

Posts: 2724
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

### Re: Universal construction of complex patterns from 1 cell

muzik wrote:Well, that would be the limit were the ship to stay as a single cell forever. If that wasn't the case, i'm pretty sure the range of speeds would be a lot higher.

Well, I thought you meant the ship would only have to be a single cell in at least one phase. Otherwise you're not talking about my idea; that would be something unrelated. To be fair, I guess you did say "a concept similar to this".

Either way, there are only a finite number of RuleLoader rules. Therefore, there are only a finite number of one-cell speeds, though they can probably get pretty slow; I can imagine someone making a rule where a single cell creates a computer which computes graham's number and writes it in binary and counts up to it and moves one cell or something; something that you could never run in its entirety.
succ

blah

Posts: 221
Joined: April 9th, 2016, 7:22 pm

### Re: Universal construction of complex patterns from 1 cell

blah wrote:Does anyone find this idea interesting or useful? I don't know if it really has any significant implications; I guess it might be nice as an example pattern in Golly, though there is plenty of room for optimisation, including an idea I had that would probably make it twice as fast.

Interesting, definitely. Useful -- that's always a loaded word. It's useful as a way to teach people how to creatively misuse rule-table format, if nothing else...!

The rule table is big enough that I'd like to add a ZIP file, ironically enough, to Very Large Patterns in Golly's online archives. It will be the smallest Very Large Pattern ever, unless you can figure out how to pull a similar trick starting from empty space.

(It seems obviously impossible, since in a normal universe there's no way to pick a cell to start from. But maybe it's possible to work in from the corners of a non-torus bounded grid somehow, by taking advantage of the different number of neighbors at a corner...?)

(Well, no, never mind -- I think cells outside the border are still counted, they're just always OFF.)

(So it would have to be a non-torus bounded grid multistate B0-type rule...)

Anyway -- should I wait for a twice-as-fast version of the Mona Lisa Rule, or just go ahead and collect this version to check in?

dvgrn
Moderator

Posts: 4481
Joined: May 17th, 2009, 11:00 pm

### Re: Universal construction of complex patterns from 1 cell

dvgrn wrote:Anyway -- should I wait for a twice-as-fast version of the Mona Lisa Rule, or just go ahead and collect this version to check in?

I've thought about it, and my twice-as-fast idea contradicts itself (it required stopping the arm when it would already be at c), but I could probably make one where the horizontal arms extrude at c/2 instead of c/3 by sending "start" and "stop" signals to the arm at c. Either way, I don't really feel like going back and optimising it; there's a certain point where further optimisation is just boring, and I think I've reached that, although I did generate this interesting image while trying to remove redundant transitions:

accidentalderivativeart.png (49.68 KiB) Viewed 2193 times

Anyway, yeah, you should use the rule as it is rather than waiting.

(Doesn't Golly have a bug where on an unbounded grid, running a RuleLoader rule with b0 results in exponentially bigger squares? Maybe you could make something happen at one of the corners. Bounded grids would probably be easier to use, though; just make everything go from state 0 straight to some other state. I'll try that.)

(Golly just crashed, and I misspelled it "Folly" when I wrote that, so maybe this is a bad idea.)
succ

blah

Posts: 221
Joined: April 9th, 2016, 7:22 pm

### Re: Universal construction of complex patterns from 1 cell

Just a minor note, now that I've built the attached file anyway:

In cases where you're making a ZIP file of rule text that goes with a particular pattern, it might as well be in the following form. That way when you File > Open the archive directly in Golly, the rule gets installed automatically and the pattern opens, all in one swell foop.

monalisa.zip
Trivial one-cell pattern and Mona-Lisa-making rule in one super convenient package

dvgrn
Moderator

Posts: 4481
Joined: May 17th, 2009, 11:00 pm

### Re: Universal construction of complex patterns from 1 cell

How about a rule that prints ITSELF?
One big dirty Oro. Yeeeeeeeeee...

gameoflifemaniac

Posts: 581
Joined: January 22nd, 2017, 11:17 am
Location: Poland

### Re: Universal construction of complex patterns from 1 cell

gameoflifemaniac wrote:How about a rule that prints ITSELF?

If we just imagine it's a binary format corresponding to the .rule file, it probably exists.

I guess you'd have to have the ROM output into a tape that stores all the states O has taken, in addition to having that ROM be used to construct a computer. The computer would then be programmed to print the beginning of the .rule, and then it would go through the history of O's states and construct a set of transitions out of that.

Kind of like a Von Neumann machine, but the instruction tape would come first, and the computer would kind of be built by it. Also it wouldn't be a direct replicator, just a quine.

Maybe there's a simpler way to do that.
succ

blah

Posts: 221
Joined: April 9th, 2016, 7:22 pm

### Re: Universal construction of complex patterns from 1 cell

dvgrn wrote:In cases where you're making a ZIP file of rule text that goes with a particular pattern, it might as well be in the following form. ...

A minor annoyance with this approach is that it opens the Help window. It's easy to avoid that by creating a zip file with a single Lua script that writes the .rule file in the right place and then writes and opens a temporary pattern file. The script's general structure looks like this:

`local g = golly()rulename = g.getdir("rules").."BLAHMONALISA.rule"f = io.open(rulename, "w")if f then    f:write([[@RULE BLAHMONALISAetc...]]    )    f:close()endpattname = g.getdir("temp").."monalisa.rle"f = io.open(pattname, "w")if f then    f:write([[x = 1, y = 1, rule = BLAHMONALISAA!]]    )    f:close()endg.open(pattname)g.show("Rule file was created: "..rulename)`

Here's the resulting zip file:
Attachments
monalisa2.zip

Andrew
Moderator

Posts: 656
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia

### Re: Universal construction of complex patterns from 1 cell

Andrew wrote:A minor annoyance with this approach is that it opens the Help window. It's easy to avoid that by creating a zip file with a single Lua script that writes the .rule file in the right place and then writes and opens a temporary pattern file.

I'd say that's not a bug but a feature -- I liked it that Golly informed me that it had installed a new rule earlier, when I tried dvgrn's ZIP file. I usually would expect that merely *opening* a file (a pattern, even if it is in ZIP form and comes with a custom rule) is a stateless action that leaves Golly unchanged when you close the file again, so I was quite happy that Golly informed me that an enduring change had indeed been made.
If you speak, your speech must be better than your silence would have been. — Arabian proverb

Catagolue: Apple Bottom • Life Wiki: Apple Bottom • Twitter: @_AppleBottom_

Proud member of the Pattern Raiders!

Apple Bottom

Posts: 901
Joined: July 27th, 2015, 2:06 pm

### Re: Universal construction of complex patterns from 1 cell

Apple Bottom wrote:I liked it that Golly informed me that it had installed a new rule earlier, when I tried dvgrn's ZIP file.

Well, it would be trivial to add a g.note call to my version stating that a .rule file has been created. That would be even more informative than Dave's version, given that the Help window is opened behind the main window and you have to bring it to the front to see what it says.

EDIT: A g.show call at the very end of the script would be better than g.note. That's a nicer compromise for people like me who don't want to see any sort of window or dialog appear and people like AB who'd like to be notified that a .rule file was created. I've updated the above zip file to call g.show.

Andrew
Moderator

Posts: 656
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia

### Re: Universal construction of complex patterns from 1 cell

blah wrote:

Sadly, it requires quite a bit of minimal configuration and tweaking, and it would take a while to explain, so I might as well spend that effort writing a program which is simpler to use rather than explaining how to use the hacked-together .c++ file that I wrote over the course of ~5 hours.

I did this. I recently decided to go back to this project and work on my hacked-together .c++ file, and now it can take arbitary xpm images as input (with some restrictions, detailed in the source code).

I modified the rule to make the arm destroy itself once it has finished generating the picture, thus removing the ugly arm that used to stay there. The background is completely black now, instead of grey. I made it skip redundant transitions, so it seems to run faster now.

Here's the new faster, smaller, better mona lisa rule:
BLAHMONALISA2.txt.zip

And dvgrn, where did you even put the older one? You mentioned putting it in a pattern collection, but I've never seen it in any of the collections I could find.

Also, over the course of this project I've seen a large amount of weird, distorted mona lisas. I like this one in particular:
you're tearing me apart
man.png (32.32 KiB) Viewed 1269 times

I have no idea what happened there.

Here's the c++ code along with a random xpm file that I prepared earlier. The sufficiently motivated reader could follow the instructions and hope I didn't forget something:
xpm2rule.zip
succ

blah

Posts: 221
Joined: April 9th, 2016, 7:22 pm

### Re: Universal construction of complex patterns from 1 cell

blah wrote:... dvgrn, where did you even put the older one? You mentioned putting it in a pattern collection, but I've never seen it in any of the collections I could find.

You're right, that checkin is still in the works. Mona Lisa has been added to a big pile of patterns that belong in Help > Online Archives > Very Large Patterns.

Unfortunately many of those patterns need minor adjustments and better comments and so on, before they're checked in. That project always seems to end up at the low end of the priority list -- because it can be done any time, so it doesn't benefit from the, um, productive panic associated with imminent Golly releases.

Thanks for the reminder, and the update -- now we might as well check in the latest and greatest.

Your rule file has a .txt extension again for some reason, so people can't try this new version without going through multiple steps -- at minimum it's extract, open in text editor, Ctrl+C, then in Golly Ctrl+Shift+O, but that's only if they know that that works. Some people may end up doing extract, rename to .rule, move to Rules folder, Control > Set Rule in Golly, draw a dot. All very awkward.

Why not just post in a usable form in the first place? I might get more good stuff checked in to Very Large Patterns quicker that way. Here's a version that Just Works:

Mona-Lisa-from-one-cell-by-blah.zip
Lua script ZIP archive following Andrew's packaging suggestion

dvgrn
Moderator

Posts: 4481
Joined: May 17th, 2009, 11:00 pm