Universal construction of complex patterns from 1 cell

For discussion of other cellular automata.
blah
Posts: 272
Joined: April 9th, 2016, 7:22 pm

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:

Code: Select all

``````x = 1, y = 1, rule = BLAHMONALISA
A!
``````
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

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

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?

Code: Select all

``````o3b2ob2obo3b2o2b2o\$bo3b2obob3o3bo2bo\$2bo2b3o5b3ob4o\$3o3bo2bo2b3o3b3o\$
4bo4bobo4bo\$2o2b2o2b4obo2bo3bo\$2ob4o3bo2bo2bo2bo\$b2o3bobob2o\$3bobobo5b
obobobo\$3bobobob2o3bo2bobo!
``````
(Check gen 3)

blah
Posts: 272
Joined: April 9th, 2016, 7:22 pm

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

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

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.

Code: Select all

``````o3b2ob2obo3b2o2b2o\$bo3b2obob3o3bo2bo\$2bo2b3o5b3ob4o\$3o3bo2bo2b3o3b3o\$
4bo4bobo4bo\$2o2b2o2b4obo2bo3bo\$2ob4o3bo2bo2bo2bo\$b2o3bobob2o\$3bobobo5b
obobobo\$3bobobob2o3bo2bobo!
``````
(Check gen 3)

blah
Posts: 272
Joined: April 9th, 2016, 7:22 pm

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

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

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:

Code: Select all

``````@RULE SAKASMILEY

#State 1 is the drawing state, so do state 2
@TABLE
n_states:14
neighborhood:vonNeumann
symmetries:none
#State 2
2,0,0,0,0,1
0,0,0,0,2,3
#State 3
0,0,0,0,3,4
3,0,0,0,1,0
#State 4
0,0,0,0,4,5
4,0,0,0,0,0
#State 5
5,0,0,0,0,1
0,5,0,0,0,6
#State 6
6,1,0,0,0,0
0,6,0,0,0,7
#State 7
7,0,0,0,0,1
0,0,7,0,0,8
#State 8
8,0,1,0,0,0
0,0,8,0,0,9
#State 9
9,0,0,0,0,0
0,0,9,0,0,10
#State 10
10,0,0,0,0,1
0,10,0,0,0,11
#State 11
11,1,0,0,0,0
0,0,0,0,11,12
#State 12
12,0,0,0,0,1
0,0,0,0,12,13
#State 13
13,0,0,0,1,1``````
This:

Code: Select all

``````x = 1, y = 1, rule = SAKASMILEY
B!
``````

Code: Select all

``````o3b2ob2obo3b2o2b2o\$bo3b2obob3o3bo2bo\$2bo2b3o5b3ob4o\$3o3bo2bo2b3o3b3o\$
4bo4bobo4bo\$2o2b2o2b4obo2bo3bo\$2ob4o3bo2bo2bo2bo\$b2o3bobob2o\$3bobobo5b
obobobo\$3bobobob2o3bo2bobo!
``````
(Check gen 3)

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

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?
Bored of using the Moore neighbourhood for everything? Introducing the Range-2 von Neumann isotropic non-totalistic rulespace!

blah
Posts: 272
Joined: April 9th, 2016, 7:22 pm

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

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

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.
Bored of using the Moore neighbourhood for everything? Introducing the Range-2 von Neumann isotropic non-totalistic rulespace!

blah
Posts: 272
Joined: April 9th, 2016, 7:22 pm

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

dvgrn
Moderator
Posts: 6739
Joined: May 17th, 2009, 11:00 pm
Contact:

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?

blah
Posts: 272
Joined: April 9th, 2016, 7:22 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 7259 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

dvgrn
Moderator
Posts: 6739
Joined: May 17th, 2009, 11:00 pm
Contact:

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

gameoflifemaniac
Posts: 1050
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Universal construction of complex patterns from 1 cell

How about a rule that prints ITSELF?
I was so socially awkward in the past and it will haunt me for my entire life.

blah
Posts: 272
Joined: April 9th, 2016, 7:22 pm

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

Andrew
Moderator
Posts: 771
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

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:

Code: Select all

``````local g = golly()
rulename = g.getdir("rules").."BLAHMONALISA.rule"
f = io.open(rulename, "w")
if f then
f:write(
[[
@RULE BLAHMONALISA

etc...

]]
)
f:close()
end

pattname = g.getdir("temp").."monalisa.rle"
f = io.open(pattname, "w")
if f then
f:write(
[[
x = 1, y = 1, rule = BLAHMONALISA
A!
]]
)
f:close()
end
g.open(pattname)
g.show("Rule file was created: "..rulename)
``````
Here's the resulting zip file:
Attachments
monalisa2.zip

Apple Bottom
Posts: 1033
Joined: July 27th, 2015, 2:06 pm
Contact:

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!

Andrew
Moderator
Posts: 771
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

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.

blah
Posts: 272
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.
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 6335 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

dvgrn
Moderator
Posts: 6739
Joined: May 17th, 2009, 11:00 pm
Contact:

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

otismo
Posts: 308
Joined: August 18th, 2010, 1:41 pm
Location: Florida
Contact:

Re: Universal construction of complex patterns from 1 cell

wo!
did I just witness the Big Bang, again, or what ?
mo.png (191.58 KiB) Viewed 900 times
In the Game of Life there are no winners there are no losers there are only SURVIVORS.
.....**
...****
.******
*( ͡° ͜ʖ ͡°)*

Code: Select all

``````#CXRLE Pos=0,0
x = 26, y = 34, rule = B3/S23
23bo\$23bobo\$23b2o9\$2b3o2\$o5bo\$o5bo\$o5bo2\$2b3o5b2o\$10b2o3\$2b2o\$2b2o10\$
15b2o\$15b2o!
``````

Moosey
Posts: 3294
Joined: January 27th, 2019, 5:54 pm
Location: A house, or perhaps the OCA board. Or [click to not expand]
Contact:

Re: Universal construction of complex patterns from 1 cell

gameoflifemaniac wrote:
September 20th, 2017, 10:30 am
How about a rule that prints ITSELF?
I'll raise you basically every rule:
How about a rule that prints every possible 10^100 x 10^100 patterns?
like this but a ruletable
I am a prolific creator of many rather pathetic googological functions

My CA rules can be found here

Also, the tree game
Bill Watterson once wrote: "How do soldiers killing each other solve the world's problems?"

otismo
Posts: 308
Joined: August 18th, 2010, 1:41 pm
Location: Florida
Contact:

Re: Universal construction of complex patterns from 1 cell

um... ( still trying to digest it all )

guys...I know this is probably the wrong place to ask

but how about a script that makes the one-cell-printer from a selection ?

and THEN

make a multi-colored bitmap paste-enabled GOLLY

( just kidding... )

P.S. do we have enuf room ? is 4 billion terabytes enuf ?

Can U imagine people seeing this for the very first time on their Impossibly Large Screen TVs ( HDMI Plug N Play ) ?
In the Game of Life there are no winners there are no losers there are only SURVIVORS.
.....**
...****
.******
*( ͡° ͜ʖ ͡°)*

Code: Select all

``````#CXRLE Pos=0,0
x = 26, y = 34, rule = B3/S23
23bo\$23bobo\$23b2o9\$2b3o2\$o5bo\$o5bo\$o5bo2\$2b3o5b2o\$10b2o3\$2b2o\$2b2o10\$
15b2o\$15b2o!
``````

dvgrn
Moderator
Posts: 6739
Joined: May 17th, 2009, 11:00 pm
Contact:

Re: Universal construction of complex patterns from 1 cell

otismo wrote:
December 8th, 2019, 6:23 pm
I know this is probably the wrong place to ask

but how about a script that makes the one-cell-printer from a selection ?
See xpm2rule.zip, five posts up. If you want it in Python or Lua, it doesn't look too difficult to port it over.

-- Not that I'm volunteering. Instead, I'm finally putting a version of the one-cell Mona Lisa generator, with some comments added to the Lua-generated one-cell pattern file, into the online Very Large Pattern collection. This pattern cleanup/checkin stuff must be a task that I really, really prefer to avoid.

Hooloovoo
Posts: 37
Joined: July 11th, 2015, 8:59 pm

Re: Universal construction of complex patterns from 1 cell

Andrew wrote:
September 20th, 2017, 6:19 pm
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.is:

Code: Select all

``snip``