Can hashlife draw a long line?

For scripts to aid with computation or simulation in cellular automata.
Post Reply
ntdsc
Posts: 68
Joined: November 13th, 2017, 1:12 pm

Can hashlife draw a long line?

Post by ntdsc » March 12th, 2018, 4:00 pm

I'm trying to make a diagonal line at least 20,000 cells in length. I don't know if you can tweak the code in Golly to draw things from a program perspective (like draw a diagonal line 20,000 cells in length) or can you do that in hashlife? Can you zoom in and out in hashlife like in Golly?

hashlife: http://tomas.rokicki.com/hlife/

Basically I'm trying to find something as fast as golly, but can automate drawing a single diagonal line (I'm currently copying and pasting in Golly). I don't think I need to used hashlife for the purpose of finding a pattern in the far future because the pattern is explosive (and thus the central area would be too large if it's way in the future and would completely bog down). The pattern is a small central area with four very long diagonals emanating from it. 4 runners shoot down the diagonals and when the runners reach the end of their line, I start recording the video of the central area. Just copying and pasting is working, but it would take several days to get 20,000 cells in length of all 4 diagonals made. And the rule is B3/S12456. By the way, by inverting the colors (black to white and white to black), I have noticed at the 2000 cell diagonal length, after video compressing, little short string feelers like aemoba along the 4 sharp v's at the central area. As the line length increases, due to video compression, the indentations along the edge of the large X will increase, and the aemebas should reach into the central oscillator, and that's when I think something interesting will happen, but it's with the colors inverted, so it looks like a dark star in a field of white.

rokicki
Posts: 80
Joined: August 6th, 2009, 12:26 pm

Re: Can hashlife draw a long line?

Post by rokicki » March 12th, 2018, 4:52 pm

Just write a tiny Lua script for Golly.

There is draw-lines.lua already distributed with Golly that will let you draw lines of arbitrary
length in any rule/algorithm.

ntdsc
Posts: 68
Joined: November 13th, 2017, 1:12 pm

Re: Can hashlife draw a long line?

Post by ntdsc » March 12th, 2018, 5:13 pm

Thank you. This is the pattern:

Code: Select all

x = 588, y = 588, rule = B3/S12456
586bo$o584bo$bo582bo$2bo580bo$3bo578bo$4bo576bo$5bo574bo$6bo572bo$7bo
570bo$8bo568bo$9bo566bo$10bo564bo$11bo562bo$12bo560bo$13bo558bo$14bo
556bo$15bo554bo$16bo552bo$17bo550bo$18bo548bo$19bo546bo$20bo544bo$21bo
542bo$22bo540bo$23bo538bo$24bo536bo$25bo534bo$26bo532bo$27bo530bo$28bo
528bo$29bo526bo$30bo524bo$31bo522bo$32bo520bo$33bo518bo$34bo516bo$35bo
514bo$36bo512bo$37bo510bo$38bo508bo$39bo506bo$40bo504bo$41bo502bo$42bo
500bo$43bo498bo$44bo496bo$45bo494bo$46bo492bo$47bo490bo$48bo488bo$49bo
486bo$50bo484bo$51bo482bo$52bo480bo$53bo478bo$54bo476bo$55bo474bo$56bo
472bo$57bo470bo$58bo468bo$59bo466bo$60bo464bo$61bo462bo$62bo460bo$63bo
458bo$64bo456bo$65bo454bo$66bo452bo$67bo450bo$68bo448bo$69bo446bo$70bo
444bo$71bo442bo$72bo440bo$73bo438bo$74bo436bo$75bo434bo$76bo432bo$77bo
430bo$78bo428bo$79bo426bo$80bo424bo$81bo422bo$82bo420bo$83bo418bo$84bo
416bo$85bo414bo$86bo412bo$87bo410bo$88bo408bo$89bo406bo$90bo404bo$91bo
402bo$92bo400bo$93bo398bo$94bo396bo$95bo394bo$96bo392bo$97bo390bo$98bo
388bo$99bo386bo$100bo384bo$101bo382bo$102bo380bo$103bo378bo$104bo376bo
$105bo374bo$106bo372bo$107bo370bo$108bo368bo$109bo366bo$110bo364bo$
111bo362bo$112bo360bo$113bo358bo$114bo356bo$115bo354bo$116bo352bo$117b
o350bo$118bo348bo$119bo346bo$120bo344bo$121bo342bo$122bo340bo$123bo
338bo$124bo336bo$125bo334bo$126bo332bo$127bo330bo$128bo328bo$129bo326b
o$130bo324bo$131bo322bo$132bo320bo$133bo318bo$134bo316bo$135bo314bo$
136bo312bo$137bo310bo$138bo308bo$139bo306bo$140bo304bo$141bo302bo$142b
o300bo$143bo298bo$144bo296bo$145bo294bo$146bo292bo$147bo290bo$148bo
288bo$149bo286bo$150bo284bo$151bo282bo$152bo280bo$153bo278bo$154bo276b
o$155bo274bo$156bo272bo$157bo270bo$158bo268bo$159bo266bo$160bo264bo$
161bo262bo$162bo260bo$163bo258bo$164bo256bo$165bo254bo$166bo252bo$167b
o250bo$168bo248bo$169bo246bo$170bo244bo$171bo242bo$172bo240bo$173bo
238bo$174bo236bo$175bo234bo$176bo232bo$177bo230bo$178bo228bo$179bo226b
o$180bo224bo$181bo222bo$182bo220bo$183bo218bo$184bo216bo$185bo214bo$
186bo212bo$187bo210bo$188bo208bo$189bo206bo$190bo204bo$191bo202bo$192b
o200bo$193bo198bo$194bo196bo$195bo194bo$196bo192bo$197bo190bo$198bo
188bo$199bo186bo$200bo184bo$201bo182bo$202bo180bo$203bo178bo$204bo176b
o$205bo174bo$206bo172bo$207bo170bo$208bo168bo$209bo166bo$210bo164bo$
211bo162bo$212bo160bo$213bo158bo$214bo156bo$215bo154bo$216bo152bo$217b
o150bo$218bo148bo$219bo146bo$220bo144bo$221bo142bo$222bo140bo$223bo
138bo$224bo136bo$225bo134bo$226bo132bo$227bo130bo$228bo128bo$229bo126b
o$230bo124bo$231bo122bo$232bo120bo$233bo118bo$234bo116bo$235bo114bo$
236bo112bo$237bo110bo$238bo108bo$239bo106bo$240bo104bo$241bo102bo$242b
o100bo$243bo98bo$244bo96bo$245bo94bo$246bo92bo$247bo90bo$248bo88bo$
249bo86bo$250bo84bo$251bo82bo$252bo80bo$253bo78bo$254bo76bo$255bo74bo$
256bo72bo$257bo70bo$258bo68bo$259bo66bo$260bo64bo$261bo62bo$262bo60bo$
263bo58bo$264bo56bo$265bo54bo$266bo52bo$267bo50bo$268bo48bo$269bo46bo$
270bo44bo$271bo42bo$272bo40bo$273bo38bo$274bo36bo$275bo34bo$276bo32bo$
277bo30bo$278bo14b2o12bo$279bo13b3o5b6o$280b7o6bo2bo3bo5bo$280bo5bo6bo
3bobo3bo2bo$280bo2bo2b16o2bobo$280bobobob6o4b6obo2bo$280bo4bob4o6b4obo
3bo$280bo2b2obob2o8b2obob4o$281bob3obo12bob3o$282b5obo10bob4o$283b4o2b
ob6obo2b4o$282b4o4bo6bo4b3o$281bob2o4bobo4bobo4b2o$280bo2bo5bo2bo2bo2b
o5bo$279b2o2bo5bo3b2o3bo5b5o$279b5o5bo3b2o3bo5bo2b2o$283bo5bo2bo2bo2bo
5bo2bo$283b2o4bobo4bobo4b2obo$283b3o4bo6bo4b4o$283b4o2bob6obo2b4o$283b
4obo10bob5o$283b3obo12bob3obo$281b4obob2o8b2obob2o2bo$281bo3bob4o6b4ob
o4bo$281bo2bob6o4b6obobobo$281bobo2b16o2bo2bo$281bo2bo3bobo3bo6bo5bo$
281bo5bo3bo2bo6b7o$281b6o5b3o13bo$280bo12b2o14bo$279bo30bo$278bo32bo$
277bo34bo$276bo36bo$275bo38bo$274bo40bo$273bo42bo$272bo44bo$271bo46bo$
270bo48bo$269bo50bo$268bo52bo$267bo54bo$266bo56bo$265bo58bo$264bo60bo$
263bo62bo$262bo64bo$261bo66bo$260bo68bo$259bo70bo$258bo72bo$257bo74bo$
256bo76bo$255bo78bo$254bo80bo$253bo82bo$252bo84bo$251bo86bo$250bo88bo$
249bo90bo$248bo92bo$247bo94bo$246bo96bo$245bo98bo$244bo100bo$243bo102b
o$242bo104bo$241bo106bo$240bo108bo$239bo110bo$238bo112bo$237bo114bo$
236bo116bo$235bo118bo$234bo120bo$233bo122bo$232bo124bo$231bo126bo$230b
o128bo$229bo130bo$228bo132bo$227bo134bo$226bo136bo$225bo138bo$224bo
140bo$223bo142bo$222bo144bo$221bo146bo$220bo148bo$219bo150bo$218bo152b
o$217bo154bo$216bo156bo$215bo158bo$214bo160bo$213bo162bo$212bo164bo$
211bo166bo$210bo168bo$209bo170bo$208bo172bo$207bo174bo$206bo176bo$205b
o178bo$204bo180bo$203bo182bo$202bo184bo$201bo186bo$200bo188bo$199bo
190bo$198bo192bo$197bo194bo$196bo196bo$195bo198bo$194bo200bo$193bo202b
o$192bo204bo$191bo206bo$190bo208bo$189bo210bo$188bo212bo$187bo214bo$
186bo216bo$185bo218bo$184bo220bo$183bo222bo$182bo224bo$181bo226bo$180b
o228bo$179bo230bo$178bo232bo$177bo234bo$176bo236bo$175bo238bo$174bo
240bo$173bo242bo$172bo244bo$171bo246bo$170bo248bo$169bo250bo$168bo252b
o$167bo254bo$166bo256bo$165bo258bo$164bo260bo$163bo262bo$162bo264bo$
161bo266bo$160bo268bo$159bo270bo$158bo272bo$157bo274bo$156bo276bo$155b
o278bo$154bo280bo$153bo282bo$152bo284bo$151bo286bo$150bo288bo$149bo
290bo$148bo292bo$147bo294bo$146bo296bo$145bo298bo$144bo300bo$143bo302b
o$142bo304bo$141bo306bo$140bo308bo$139bo310bo$138bo312bo$137bo314bo$
136bo316bo$135bo318bo$134bo320bo$133bo322bo$132bo324bo$131bo326bo$130b
o328bo$129bo330bo$128bo332bo$127bo334bo$126bo336bo$125bo338bo$124bo
340bo$123bo342bo$122bo344bo$121bo346bo$120bo348bo$119bo350bo$118bo352b
o$117bo354bo$116bo356bo$115bo358bo$114bo360bo$113bo362bo$112bo364bo$
111bo366bo$110bo368bo$109bo370bo$108bo372bo$107bo374bo$106bo376bo$105b
o378bo$104bo380bo$103bo382bo$102bo384bo$101bo386bo$100bo388bo$99bo390b
o$98bo392bo$97bo394bo$96bo396bo$95bo398bo$94bo400bo$93bo402bo$92bo404b
o$91bo406bo$90bo408bo$89bo410bo$88bo412bo$87bo414bo$86bo416bo$85bo418b
o$84bo420bo$83bo422bo$82bo424bo$81bo426bo$80bo428bo$79bo430bo$78bo432b
o$77bo434bo$76bo436bo$75bo438bo$74bo440bo$73bo442bo$72bo444bo$71bo446b
o$70bo448bo$69bo450bo$68bo452bo$67bo454bo$66bo456bo$65bo458bo$64bo460b
o$63bo462bo$62bo464bo$61bo466bo$60bo468bo$59bo470bo$58bo472bo$57bo474b
o$56bo476bo$55bo478bo$54bo480bo$53bo482bo$52bo484bo$51bo486bo$50bo488b
o$49bo490bo$48bo492bo$47bo494bo$46bo496bo$45bo498bo$44bo500bo$43bo502b
o$42bo504bo$41bo506bo$40bo508bo$39bo510bo$38bo512bo$37bo514bo$36bo516b
o$35bo518bo$34bo520bo$33bo522bo$32bo524bo$31bo526bo$30bo528bo$29bo530b
o$28bo532bo$27bo534bo$26bo536bo$25bo538bo$24bo540bo$23bo542bo$22bo544b
o$21bo546bo$20bo548bo$19bo550bo$18bo552bo$17bo554bo$16bo556bo$15bo558b
o$14bo560bo$13bo562bo$12bo564bo$11bo566bo$10bo568bo$9bo570bo$8bo572bo$
7bo574bo$6bo576bo$5bo578bo$4bo580bo$3bo582bo$2bo584bo$bo!
If any of you want to draw it, notice that the two top lines, one is always longer by one cell, same with the bottom two lines, since the center square corner is shifted in height by one cell relative to the one on the right. The reason there are indentations in the automata along the X, is that the long line is also shifted relative to the two small crossing lines in the center square (to make a clockwise pattern). But it's that single shift that bows in along the X, like a wave, and as the diagonal line increases, those indentations get deeper and deeper, until needles should show up along the length (in the actual uncompressed automata some time after execution along the X). And it's the color inversion. Before I was looking on the perimeter for ghost cells from compression, now the ameobas are strings that point towards the center and move like a feeler after video compression (I use action 3.0 beta). What may happen (since the X can be viewed as 2 long crossing tubes). A large ball may appear at the center, and then gyrate, and a smaller ball may shoot down in one direction of the 2 crossing tubes (As a large X). So a grid of the X's may need to be made like in this video: https://www.youtube.com/watch?v=AA_U17L ... Q&index=11

Although it's a normal automata, due to the X formation in a grid of them like in the video, it's now a Von Neumann neighborhood, and those small balls that may appear and shoot down the tubes would be a quantum version of the billiard ball computer (Von Neumann automatas can make billiard ball computers).

In effect the ball would be a soliton (or glider) that comes from video compression, and the large ball that disintegrates forms a toothy boundary for the small ball, that would be phase shifted like in a boson sampler. That's what I'm considering now, but to start I'll make the single large X, because creating a large grid with long diagonals may need to run on Amazon's pay by service supercomputer time so it doesn't slow down, but it may not need it.

User avatar
77topaz
Posts: 1496
Joined: January 12th, 2018, 9:19 pm

Re: Can hashlife draw a long line?

Post by 77topaz » March 12th, 2018, 5:47 pm

You can copy and paste longer and longer sections each time; that way, making a line of length n would only take O(log_2(n)) steps.

Also, I see this is quickly becoming a continuation of the "quantum computer" thread. :P

ntdsc
Posts: 68
Joined: November 13th, 2017, 1:12 pm

Re: Can hashlife draw a long line?

Post by ntdsc » March 12th, 2018, 6:41 pm

Well, when copying and pasting, if the line extends beyond the screen, it turns from green to red and won't let you paste it. But the reason the central area would gyrate in a grid like in the youtube video, the oscillators disintegrate eventually no matter how large the grid, because the ends don't continue, it's like it's cut off, and the very central X, it's oscillator would remain the longest. It gyrates initially due to its disintegration, but if the diagonals are long enough in the grid, it should maintain an oscillator shape as it travels to other central areas in adjoining X's. As it moves along, those compression remnants of stringy ameoba like feelers would stabilize it. But you can see the start of amoeba strings on the INSIDE perimeter of the automata at diagonals with 2000 cells long (and only from a compressed video centered at a certain distance from the central area, so I just zoom in and out as the video plays until the right distance, it's then seen with the 2000 diagonal length. The pattern shown I believe is only 400 cells long). When probably about 20,000 cells long, those amoeba strings would go to the center and move with the oscillator, and when disintegrated the single smaller oscillator "glider" would travel from node to node. I imagine the glider combined with the entire grid would be interpreted as an intelligence possibly and not just a computer, because it would travel around and its tip would pass information around the grid as it travels.

User avatar
77topaz
Posts: 1496
Joined: January 12th, 2018, 9:19 pm

Re: Can hashlife draw a long line?

Post by 77topaz » March 12th, 2018, 7:24 pm

ntdsc wrote:Well, when copying and pasting, if the line extends beyond the screen, it turns from green to red and won't let you paste it.
Are you aware Golly has a "zoom" function? :P

ntdsc
Posts: 68
Joined: November 13th, 2017, 1:12 pm

Re: Can hashlife draw a long line?

Post by ntdsc » March 13th, 2018, 2:16 pm

Maybe you can paste it. Can you get the curser moves to be fine enough though to put it in the right spot, because I'm not sure if the curser is fine enough when zoomed out (you'd have to look at the top x,y coordinate or latitude to see if it can move fine enough.

I haven't made the final grid, but with the color invert function in golly, as the pattern expands (it will be black X's in a white background due to inverting the normal color), the end of an X will be very sharply pointed, and as a neighbor X expands also along the same line (as in the youtube video), it will be two knives pointing toward each other when both runners expand along the same line (from neighboring X's) and meet.

In the color inverted pattern (not shown here) with a single X shape that has all 4 runners expanded, it looks like a black star. When zoomed out a bit, you can see flashes of white all over the X, or star shape, inside the star. When instead in a grid with neighboring X's touching at the tips, if the ameobas stabilize it, and a flow happens, those white flashes may flow down and get funnneled through the narrow crossing point or where the two knives touch.

This is Dr. Englund's quantum photonic gate where at the very center, two knives touch: link
https://phys.org/news/2017-06-prototype ... tions.html
prototypedev.jpg
prototypedev.jpg (14.78 KiB) Viewed 6933 times
Where the two diagonals meet in a grid like in the youtube video posted, those flashes of light would be funneled. The automata, at the meeting point between two X's at the place where the two knives meet, the automata may selectively only allow "flashes or light" or photons of a certain phase (or frequency) to pass, while rejecting all others. Then the automata would act as a universal quantum gate in that Englund's gate (which he hasn't been able to physically make work yet due to scattering, only in computations) would work in the automata. I remember seeing a simulation of a black hole, and there were just numerous flashes of white light inside the black hole, and the black star also has flashes of light.

If you make it in a grid, the center would be clockwise (or counterclockwise you pick) and the upper left, upper right, lower left, and lower right neighbor X's would be counterclockwise. Then those counterclockwise would have clockwise around it, etc. The clockwise and counterclockwise patterns fit with no weird crossing, so it makes a continuous line, even though the diagonals shift, they fit together.

But thank you, and I'll try to see alright if the pasting can work with the curser, as my memory seems to think that it does, I was just using the mouse before.

To make the whole thing work though, you'd probably make the exact same automata, with one X white in a black background, and the identical automata only with color inverted playing at the same time. There's also circulation in the black area on the OUTSIDE of the white star (this has been only about the black star) and they would be duals of each other in the video compression sense, and with black holes, there is a dual nature to things i think, so in the end calculations where things are actually programmed both may be needed, playing at the same time, the white star and the black star.

User avatar
Rhombic
Posts: 1072
Joined: June 1st, 2013, 5:41 pm

Re: Can hashlife draw a long line?

Post by Rhombic » March 13th, 2018, 2:25 pm

Zoom out. Copy the whole thing. Zoom way in to the tip of where you want to extend the line from. Select the Paste location appropriately (i.e. if you want from bottom left to top right, choose bottom left paste location). Now you can paste with perfect accuracy.
SoL : FreeElectronics : DeadlyEnemies : 6a-ite : Rule X3VI
what is “sesame oil”?

User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Can hashlife draw a long line?

Post by dvgrn » March 14th, 2018, 9:58 am

Rhombic wrote:Zoom out. Copy the whole thing. Zoom way in to the tip of where you want to extend the line from. Select the Paste location appropriately (i.e. if you want from bottom left to top right, choose bottom left paste location). Now you can paste with perfect accuracy.
The shortcut for changing the paste location in Golly is Shift+L. Once I learned to use that instead of multiple clicks in the Edit menu, my general editing speed got faster by a significant percentage. I still haven't internalized Shift+M for the paste mode or the function keys for cursor types -- should probably learn those too.

For moderately long lines, another trick that works is to zoom to an appropriate drawing level, click to draw a cell at the very edge of the visible universe, and then move the mouse to just outside the frame -- hold it there for a while and let autoscrolling keep the line straight for you.

User avatar
SuperSupermario24
Posts: 121
Joined: July 22nd, 2014, 12:59 pm
Location: Within the infinite expanses of the Life universe

Re: Can hashlife draw a long line?

Post by SuperSupermario24 » March 18th, 2018, 1:05 am

Here's a script that creates a line starting from given x and y coordinates with a given length, state, and direction:

Code: Select all

local g = golly()
local gp = require "gplus"

local x
local y

local selection = g.getselrect()

if(#selection ~= 0) then
    x = selection[1]
    y = selection[2]
else
    x, y = gp.split(g.getstring("Enter starting coordinates (x, y).", "0, 0", "Enter coordinates"), ", ")
    x = math.tointeger(x)
    y = math.tointeger(y)
end

local input = g.getstring([[
Enter length, state, and direction.
Available directions: N, E, S, W, NE, SE, SW, NW]], "200, 1, SE", "Enter properties")

local length, state, direction = gp.split(input, ", ")
length = math.tointeger(length)
state = math.tointeger(state)

if(length <= 0) then g.exit("Length must be positive.") end

if(state < 0 or state > g.numstates() - 1) then g.exit("State is out of range.") end

local dx = 0
local dy = 0

if(direction == "N") then
    dy = -1
elseif(direction == "S") then
    dy = 1
elseif(direction == "E") then
    dx = 1
elseif(direction == "W") then
    dx = -1
elseif(direction == "NE") then
    dy = -1
    dx = 1
elseif(direction == "SE") then
    dx = 1
    dy = 1
elseif(direction == "NW") then
    dx = -1
    dy = -1
elseif(direction == "SW") then
    dx = -1
    dy = 1
else
    g.exit("Invalid direction specified.")
end

local currentx = 0
local currenty = 0
for i = 0, length - 1 do
    g.setcell(x + currentx, y + currenty, state)
    currentx = currentx + dx
    currenty = currenty + dy
end
EDIT: Changed it so that if a selection rectangle exists, it will use the top-left cell in the selection as the starting point instead of prompting the user.

Code: Select all

bobo2b3o2b2o2bo3bobo$obobobo3bo2bobo3bobo$obobob2o2bo2bobo3bobo$o3bobo3bo2bobobobo$o3bob3o2b2o3bobo2bo!

Post Reply