ConwayLife.com - A community for Conway's Game of Life and related cellular automata
Home  •  LifeWiki  •  Forums  •  Download Golly

Inconsistent one-liner RLE parsing (a feature?)

Has something gone haywire? Let us know about it!

Inconsistent one-liner RLE parsing (a feature?)

Postby Scorbie » January 14th, 2017, 2:03 am

With Golly 2.9b1 on 64bit Linux (Linux Mint), the one-line RLE of the hive is parsed as a string rather as an RLE.
bo$obo$obo$bo
(Edit: the tub, too.)
bo$obo$bo

Other patterns does not exhibit this behavior; Compare:
2o$2o

2b2o$3bo$3o$o

b2o$o2bo$bobo$2bo


Note: These RLEs have their !s at the end removed. I haven't tested it thoroughly, but all of them seem to work with the ! appended.
Best wishes to you, Scorbie
User avatar
Scorbie
 
Posts: 1358
Joined: December 7th, 2013, 1:05 am

Re: Inconsistent one-liner RLE parsing (a feature?)

Postby dvgrn » January 14th, 2017, 11:10 am

Scorbie wrote:With Golly 2.9b1 on 64bit Linux (Linux Mint), the one-line RLE of the hive is parsed as a string rather as an RLE.
bo$obo$obo$bo
(Edit: the tub, too.)
bo$obo$bo

Other patterns does not exhibit this behavior; Compare:
2o$2o

2b2o$3bo$3o$o

b2o$o2bo$bobo$2bo


Note: These RLEs have their !s at the end removed. I haven't tested it thoroughly, but all of them seem to work with the ! appended.

Little chunks of text are sometimes hard to guess, if there are no reasonably definitive markers present, like an exclamation point. Without looking at the parsing code, I'd guess that if there are no 0..9 digit characters in the text chunk, then the parser guesses that the text is an ASCII pattern.

It's a good guess in most cases. If you want it to guess better in other cases, add a ! ...
User avatar
dvgrn
Moderator
 
Posts: 4853
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI

Re: Inconsistent one-liner RLE parsing (a feature?)

Postby rowett » January 14th, 2017, 2:35 pm

dvgrn wrote:Little chunks of text are sometimes hard to guess, if there are no reasonably definitive markers present, like an exclamation point. Without looking at the parsing code, I'd guess that if there are no 0..9 digit characters in the text chunk, then the parser guesses that the text is an ASCII pattern.

It's a good guess in most cases. If you want it to guess better in other cases, add a ! ...


The code says:
// Everything seems parseable; assume this is RLE if either we saw some
// digits, or the pattern ends with a '!', both of which are unlikely to
// occur in plain text patterns:
rowett
Moderator
 
Posts: 876
Joined: January 31st, 2013, 2:34 am
Location: UK

Re: Inconsistent one-liner RLE parsing (a feature?)

Postby Scorbie » January 22nd, 2017, 10:28 am

Oh, thank you! I wasn't aware of this...
N.B. that wasn't from me, was from sample input from CatForce.
Good thing to know, especially dealing with external RLE source.

Another similar hack: To feed a single-line RLE to Golly, you just have to prepend a newline. I'm pretty sure golly doesn't mind empty first lines. (Starting the line with a hash to make a comment also works.)
Best wishes to you, Scorbie
User avatar
Scorbie
 
Posts: 1358
Joined: December 7th, 2013, 1:05 am

Re: Inconsistent one-liner RLE parsing (a feature?)

Postby BlinkerSpawn » January 22nd, 2017, 7:02 pm

Digits and trailing exclamation points aren't too uncommon in plaintext.
Multiple dollar signs in a single line would be a telltale sign of RLE though.
LifeWiki: Like Wikipedia but with more spaceships. [citation needed]

Image
User avatar
BlinkerSpawn
 
Posts: 1779
Joined: November 8th, 2014, 8:48 pm
Location: Getting a snacker from R-Bee's

Re: Inconsistent one-liner RLE parsing (a feature?)

Postby calcyman » January 24th, 2017, 4:33 am

BlinkerSpawn wrote:Digits and trailing exclamation points aren't too uncommon in plaintext.
Multiple dollar signs in a single line would be a telltale sign of RLE though.


Conversely, plaintext patterns tend to only contain .*o$ and newlines. Multiple dollars can occur in a single line, since Dean Hickerson used them to abbreviate ten spaces.
What do you do with ill crystallographers? Take them to the mono-clinic!
User avatar
calcyman
 
Posts: 1694
Joined: June 1st, 2009, 4:32 pm


Return to Bugs & Errors

Who is online

Users browsing this forum: No registered users and 1 guest