Empty lines in RLE

For general discussion about Conway's Game of Life.
Post Reply
User avatar
BZH314
Posts: 16
Joined: August 26th, 2018, 6:05 am
Contact:

Empty lines in RLE

Post by BZH314 » August 26th, 2018, 7:27 am

RLE seems to ignore empty lines.
Is this a limitation (which justified the existence of other encodings?) that prevents RLE to work with patterns with empty lines, or is my implementation RLE wrong?
Thanks

Examples:

1. Hooks

Code: Select all

6b2o3b$ob2obobo3b$2obobo5b$4b2o5b$5bo5b2$7b2o2b$7bo3b$8b3o$10bo!
Would not work at all, but adding an extra $ where the empty line is works:

Code: Select all

6b2o3b$ob2obobo3b$2obobo5b$4b2o5b$5bo5b2$$7b2o2b$7bo3b$8b3o$10bo!
The Hooks example is illustrated in this short video on Twitch.tv:
Hooks (RLE with empty line) - Twitch Plays Conway's Game of Life (Unity3d ECS Prototype #7)

2. 74P8H2V0

Code: Select all

5bobobo$4b7o$4bo5bo$5bo3bo$5bo3bo$3b2o5b2o$5bo3bo$2bobobobobobo$4bobobobo$b2obobobobob2o$bo3b2ob2o3bo2$2o3bo3bo3b2o$5bo3bo$6b3o2$4bo4b2o$3bobo2b2o$6bo2bobo$3bo2bo2bobo$4bobo3bo!
Would not work at all, but adding two extra $ where the two empty lines are works:

Code: Select all

5bobobo$4b7o$4bo5bo$5bo3bo$5bo3bo$3b2o5b2o$5bo3bo$2bobobobobobo$4bobobobo$b2obobobobob2o$bo3b2ob2o3bo2$$2o3bo3bo3b2o$5bo3bo$6b3o2$$4bo4b2o$3bobo2b2o$6bo2bobo$3bo2bo2bobo$4bobo3bo!

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

Re: Empty lines in RLE

Post by 77topaz » August 26th, 2018, 7:42 am

It's your implementation that's causing the errors. The upper RLEs in each pair are the ones that should work correctly (and do in LifeViewer etc.).

User avatar
BZH314
Posts: 16
Joined: August 26th, 2018, 6:05 am
Contact:

Re: Empty lines in RLE

Post by BZH314 » August 26th, 2018, 8:03 am

Thank you for the quick reply.
How would LifeViewer "know" where the empty line is from the RLE file?
I apologize if this is obvious to you and I'm missing something, but how can you infer where the blank line is by just parsing the Hooks RLE file?

Code: Select all

#N Hooks
#C A period 5 oscillator.
#C www.conwaylife.com/wiki/Hooks
x = 11, y = 10, rule = b3/s23
6b2o3b$ob2obobo3b$2obobo5b$4b2o5b$5bo5b2$7b2o2b$7bo3b$8b3o$10bo!
y is set to 10, and there are only 9 lines defined (the 8 $ and one !), so it seems to be an indication that there is an empty line, but how do you tell where to insert it?

Thank you very much for your time

User avatar
BZH314
Posts: 16
Joined: August 26th, 2018, 6:05 am
Contact:

Re: Empty lines in RLE

Post by BZH314 » August 26th, 2018, 8:06 am

gah sorry, becomes obvious now, of course, the empty line goes out of bounds on y.
Sorry to have wasted your time but you did really help!
Last edited by BZH314 on August 26th, 2018, 8:07 am, edited 1 time in total.

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

Re: Empty lines in RLE

Post by 77topaz » August 26th, 2018, 8:06 am

If you look at the RLE carefully, you'll see that, at the location where the blank line is, there is a 2 in front of the $ (the new-line character), just like how two on cells can be represented by 2o instead of oo.

User avatar
BZH314
Posts: 16
Joined: August 26th, 2018, 6:05 am
Contact:

Re: Empty lines in RLE

Post by BZH314 » August 26th, 2018, 8:21 am

Thank you so much 77topaz, you nailed it: I missed that the $ end of line character can also be preceded with a number just like o and b.

Post Reply