Golly bugs

Has something gone haywire? Let us know about it!
Post Reply
User avatar
EvinZL
Posts: 544
Joined: November 8th, 2018, 4:15 pm
Location: A tungsten pool travelling towards the sun
Contact:

Golly bugs

Post by EvinZL » May 20th, 2021, 9:40 am

Since there seems to be way too many golly bug threads, I decided to make a unified thread for golly bugs.

For me, If Golly's stored rule or whatever has the wrong case, then it refuses to open. I can't seem to wipe it either, the layer with that rule had rule changed, I saved a pattern in another rule, I closed that layer, I made a new layer in a different rule, did another rule change, but it still has the same stored rule. Due to Golly's layer limit, this makes me unable to do stuff.

User avatar
ihatecorderships
Posts: 141
Joined: April 11th, 2021, 12:54 pm
Location: Falls Church, VA

Re: Golly bugs

Post by ihatecorderships » May 20th, 2021, 10:11 am

Renaming a rule of your own is sometimes buggy. For example, I name another OCA X, but then I delete the X name and add the name Y. It sometimes will still show the X name.

User avatar
ihatecorderships
Posts: 141
Joined: April 11th, 2021, 12:54 pm
Location: Falls Church, VA

Re: Golly bugs

Post by ihatecorderships » June 21st, 2021, 6:31 pm

(Double post cuz unrelated)

Why is switch engine ping pong in Life/Breeders and not the Hashlife folder? Catacryst, Gotts-dots and wedge grow are all there.

User avatar
Freywa
Posts: 834
Joined: June 23rd, 2011, 3:20 am
Location: Singapore
Contact:

Re: Golly bugs

Post by Freywa » September 20th, 2021, 9:08 am

The putcells() Python command is broken with respect to its "copy" mode; specifying it does not change the paste behaviour from the default "or". To illustrate:

Code: Select all

import golly as g

g.putcells(g.parse("bo!"))
g.putcells(g.parse("ob!"), 0, 0, 1, 0, 0, 1, "copy")
Running this in an empty universe gives a pattern with 2 cells instead of the expected 1. putcells() should also take keyword arguments as per the documentation – g.putcells(clist, mode="copy") should work, for example.

The "and" mode of the same function is also broken: it doesn't do anything at all. There should be documentation about how the different paste modes work, especially with respect to multi-state rules (the "not" paste mode of putcells() is not available in the GUI, and does an ANDNOT function apparently).

There should also be "add" and "subtract" paste modes. If a is the cell state already there, b is the cell state pasted in and n is the number of states in the current rule, the cell state after the paste should be (a+b) mod n for add and (a-b) mod n for subtract. This would allow arbitrary regions to be replaced with arbitrary other regions.
Princess of Science, Parcly Taxel

Code: Select all

x = 31, y = 5, rule = B2-a/S12
3bo23bo$2obo4bo13bo4bob2o$3bo4bo13bo4bo$2bo4bobo11bobo4bo$2bo25bo!

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

Re: Golly bugs

Post by dvgrn » September 20th, 2021, 4:46 pm

Freywa wrote:
September 20th, 2021, 9:08 am
The putcells() Python command is broken with respect to its "copy" mode; specifying it does not change the paste behaviour from the default "or". To illustrate:

Code: Select all

import golly as g

g.putcells(g.parse("bo!"))
g.putcells(g.parse("ob!"), 0, 0, 1, 0, 0, 1, "copy")
Running this in an empty universe gives a pattern with 2 cells instead of the expected 1.
This is a common problem to run into, but it isn't quite true that "copy" has the same behavior as "or". The problem is more that the parse() command doesn't work the way you expect. If parse() by default produced a multistate list of every cell in the bounding box, listing the OFF cells as state 0 and the ON cells as state 1, then the "copy" command would do as you expect. For example:

Code: Select all

import golly as g

bo = [0,0,0,1,0,1,0]
ob = [0,0,1,1,0,0,0]
# ob! overlays bo! in "copy" mode, leaving just one cell
g.putcells(bo)
g.putcells(ob, 0, 0, 1, 0, 0, 1, "copy")

# ob! adds a cell to bo! in "or" mode, producing two cells
g.putcells(bo,0,10)
g.putcells(ob, 0, 10, 1, 0, 0, 1, "or")
It's generally not workable to include a whole pile of useless state-0 cells in a cell list, just because they happen to be in the bounding box -- so that is not the way parse() works. parse() only makes a two-state list of the ON cells described by the parsed RLE. This is a lot faster and takes much less memory, and 99% of the time it's exactly what is needed for scripting purposes.

This means that if you want to use the "copy" option, you'll have to build your own state-0 cell list, or a function that makes the multistate list of state-0 cells and state-1 cells for you.

Post Reply