Life 1.05 to RLE - Help!

For scripts to aid with computation or simulation in cellular automata.
Post Reply
David
Posts: 212
Joined: November 3rd, 2009, 2:47 am
Location: Daejeon, South Korea

Life 1.05 to RLE - Help!

Post by David » August 22nd, 2011, 10:47 pm

I must translate Life 1.05(.lif) to RLE(.rle) - Help!

My algorithm is this.

1. Read the Life 1.05 file.
2. Find #R for rule, and #P for pattern.
3. Use them to scan a pattern.
4. Calculate width and height.
5. Make a RLE file.
6. Print width, height, rule and pattern into the RLE file.

And must be coded with C++. No another language!
Do you have any better algorithm or a source code?
Call me "Dannyu NDos" in Forum. Call me "Park Shinhwan"(박신환) in Wiki.

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

Re: Life 1.05 to RLE - Help!

Post by Andrew » August 22nd, 2011, 11:59 pm

Why restrict yourself to C++? Here's a simple Python script you can run from Golly to do the job:

Code: Select all

# Load a given .lif file and create a .rle file.
# Author: Andrew Trevorrow (andrew@trevorrow.com), Aug 2011.

import golly as g

# prompt for .lif file and load it in
lifname = g.opendialog("Open .lif file", "Lif files (*.lif)|*.lif")
if len(lifname) == 0: g.exit()
g.open(lifname)

# replace .lif extension with .rle and save resulting file
rlename = lifname.replace(".lif", ".rle")
g.save(rlename, "rle")
g.show("RLE file created: " + rlename)
If you really must use C++ then download the Golly source code and have a look at the readpclife routine in readpattern.cpp and the writerle routine in writepattern.cpp.

David
Posts: 212
Joined: November 3rd, 2009, 2:47 am
Location: Daejeon, South Korea

Re: Life 1.05 to RLE - Help!

Post by David » August 23rd, 2011, 12:20 am

Andrew wrote:Why restrict yourself to C++?
Because C++ is fast and easy.
I heard Python is slow, so please post C++ code.
Call me "Dannyu NDos" in Forum. Call me "Park Shinhwan"(박신환) in Wiki.

ebcube
Posts: 124
Joined: February 27th, 2010, 2:11 pm

Re: Life 1.05 to RLE - Help!

Post by ebcube » August 23rd, 2011, 8:07 am

C++ is definitely fast, but it's not easy.

He's already given you a Python golly script, just use that. It'll work.

David
Posts: 212
Joined: November 3rd, 2009, 2:47 am
Location: Daejeon, South Korea

Re: Life 1.05 to RLE - Help!

Post by David » August 24th, 2011, 4:34 am

It dosen't work, if there are 2 or greater #P and patterns.
(i.e. Life 1.05 files which made by torus(a search program). They are too big for that program!)
Call me "Dannyu NDos" in Forum. Call me "Park Shinhwan"(박신환) in Wiki.

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

Re: Life 1.05 to RLE - Help!

Post by Andrew » August 24th, 2011, 4:46 am

Sorry, but I don't follow you. Are you saying you have a .lif file that Golly can't load?
If so I suspect it isn't really a legal Life 1.05 file. Please post the file (or zip and attach it if really big) and I'll see what's going wrong.

David
Posts: 212
Joined: November 3rd, 2009, 2:47 am
Location: Daejeon, South Korea

Re: Life 1.05 to RLE - Help!

Post by David » August 25th, 2011, 3:57 am

Here. (I think Torus is too stupid.)

Wait... I can't upload .lif or .txt files on this forum!

So... :x

Code: Select all

#C 9, 18, 7, 10 [1314258558 #339.11]
#C period 21
#r S23/B3
#P 0 0
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 9 -8
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 18 -16
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 27 -24
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 36 -32
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 45 -40
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 54 -48
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 63 -56
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 72 -64
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 81 -72
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 90 -80
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 99 -88
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 108 -96
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 117 -104
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 126 -112
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -2 18
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 7 10
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 16 2
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 25 -6
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 34 -14
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 43 -22
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 52 -30
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 61 -38
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 70 -46
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 79 -54
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 88 -62
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 97 -70
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 106 -78
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 115 -86
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 124 -94
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -4 36
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 5 28
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 14 20
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 23 12
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 32 4
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 41 -4
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 50 -12
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 59 -20
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 68 -28
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 77 -36
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 86 -44
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 95 -52
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 104 -60
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 113 -68
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 122 -76
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -6 54
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 3 46
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 12 38
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 21 30
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 30 22
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 39 14
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 48 6
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 57 -2
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 66 -10
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 75 -18
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 84 -26
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 93 -34
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 102 -42
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 111 -50
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 120 -58
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -8 72
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 1 64
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 10 56
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 19 48
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 28 40
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 37 32
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 46 24
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 55 16
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 64 8
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 73 0
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 82 -8
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 91 -16
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 100 -24
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 109 -32
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 118 -40
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -10 90
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -1 82
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 8 74
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 17 66
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 26 58
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 35 50
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 44 42
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 53 34
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 62 26
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 71 18
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 80 10
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 89 2
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 98 -6
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 107 -14
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 116 -22
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -12 108
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -3 100
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 6 92
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 15 84
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 24 76
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 33 68
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 42 60
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 51 52
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 60 44
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 69 36
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 78 28
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 87 20
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 96 12
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 105 4
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 114 -4
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -14 126
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -5 118
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 4 110
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 13 102
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 22 94
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 31 86
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 40 78
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 49 70
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 58 62
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 67 54
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 76 46
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 85 38
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 94 30
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 103 22
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 112 14
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -16 144
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -7 136
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 2 128
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 11 120
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 20 112
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 29 104
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 38 96
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 47 88
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 56 80
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 65 72
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 74 64
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 83 56
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 92 48
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 101 40
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 110 32
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -18 162
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -9 154
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 0 146
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 9 138
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 18 130
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 27 122
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 36 114
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 45 106
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 54 98
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 63 90
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 72 82
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 81 74
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 90 66
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 99 58
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 108 50
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -20 180
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -11 172
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -2 164
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 7 156
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 16 148
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 25 140
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 34 132
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 43 124
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 52 116
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 61 108
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 70 100
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 79 92
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 88 84
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 97 76
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 106 68
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -22 198
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -13 190
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -4 182
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 5 174
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 14 166
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 23 158
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 32 150
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 41 142
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 50 134
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 59 126
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 68 118
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 77 110
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 86 102
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 95 94
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 104 86
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -24 216
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -15 208
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -6 200
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 3 192
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 12 184
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 21 176
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 30 168
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 39 160
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 48 152
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 57 144
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 66 136
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 75 128
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 84 120
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 93 112
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 102 104
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -26 234
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -17 226
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -8 218
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 1 210
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 10 202
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 19 194
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 28 186
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 37 178
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 46 170
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 55 162
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 64 154
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 73 146
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 82 138
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 91 130
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 100 122
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -28 252
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -19 244
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -10 236
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -1 228
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 8 220
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 17 212
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 26 204
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 35 196
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 44 188
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 53 180
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 62 172
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 71 164
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 80 156
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 89 148
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P 98 140
.........
......**.
.....*...
....*....
.....**..
.........
.........
.........
........*
.........
.......
.......
.......
**.....
..*....
.*.....
*......
.......

#P -59 0
*.***....
**.*..*..
....*....
*.**.**..
......*..
****..*..
..**.....
..*.*.*..
....***..
***......
*.*.*..
...**..
*..****
*......
**.**.*
..*....
*..*.**
..***.*

#P -50 -8
*.***....
**.*..*..
....*....
*.**.**..
......*..
****..*..
..**.....
..*.*.*..
....***..
***......
*.*.*..
...**..
*..****
*......
**.**.*
..*....
*..*.**
..***.*

#P -61 18
*.***....
**.*..*..
....*....
*.**.**..
......*..
****..*..
..**.....
..*.*.*..
....***..
***......
*.*.*..
...**..
*..****
*......
**.**.*
..*....
*..*.**
..***.*

#P -52 10
*.***....
**.*..*..
....*....
*.**.**..
......*..
****..*..
..**.....
..*.*.*..
....***..
***......
*.*.*..
...**..
*..****
*......
**.**.*
..*....
*..*.**
..***.*

Call me "Dannyu NDos" in Forum. Call me "Park Shinhwan"(박신환) in Wiki.

User avatar
ssaamm
Posts: 125
Joined: June 4th, 2010, 9:43 pm

Re: Life 1.05 to RLE - Help!

Post by ssaamm » August 25th, 2011, 8:34 am

.zip it!

Paul Tooke
Posts: 111
Joined: May 19th, 2010, 7:35 am
Location: Cambridge, UK

Re: Life 1.05 to RLE - Help!

Post by Paul Tooke » August 25th, 2011, 2:22 pm

There is an easy fix that doesn't require unnecessary programming. Convert it to 'correct' Life 1.05 format by putting this line at the start of the file:

Code: Select all

#Life 1.05
Golly seems perfectly happy with the pattern posted above when this line is present. It does do something strange though: it retains this line when saving the pattern as RLE. Golly is then subsequently unable to load the resulting file correctly!

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

Re: Life 1.05 to RLE - Help!

Post by Andrew » August 25th, 2011, 7:38 pm

Golly uses the info on the first (non-empty) line to determine the file format, so Life 1.05 files must begin with "#Life 1.05".
Paul Tooke wrote:Golly seems perfectly happy with the pattern posted above when this line is present. It does do something strange though: it retains this line when saving the pattern as RLE. Golly is then subsequently unable to load the resulting file correctly!
This only happens if these 2 conditions are true:

1. The file is saved with exactly the same name and extension. In this case Golly tries to preserve any existing comments and treats all lines starting with "#" as a comment (some rle files don't always use #C), so the "#Life 1.05" line gets copied into the rle file.

2. The File menu's "Save Extended RLE" option is NOT ticked. If ticked (which is the recommended setting) then the saved file starts with a "#CXRLE ..." line.

I'm not sure I'll bother fixing this problem given that if you load a .lif file and then save it as rle you should really change the extension to .rle (on my Mac this change happens automatically in the Save dialog).

User avatar
calcyman
Posts: 2106
Joined: June 1st, 2009, 4:32 pm

Re: Life 1.05 to RLE - Help!

Post by calcyman » August 26th, 2011, 3:04 am

Saving #CXRLE is the recommended setting? I thought that it was deprecated; at least, someone spent a long time "removing useless #CXRLE comment lines" from the Golly CVS archive.
What do you do with ill crystallographers? Take them to the mono-clinic!

Paul Tooke
Posts: 111
Joined: May 19th, 2010, 7:35 am
Location: Cambridge, UK

Re: Life 1.05 to RLE - Help!

Post by Paul Tooke » August 26th, 2011, 6:02 am

Andrew wrote:
This only happens if these 2 conditions are true:

1. The file is saved with exactly the same name and extension.
It also happens when the pattern is pasted into Golly, and therefore has no original filename or extension. Again, the "Save extended RLE" option must be unticked. This is how I discovered this behaviour. This may not be a sufficiently likely combination of circumstances as to warrant concern, but it is an undesirable response to a not unreasonable sequence of actions from the user. I didn't think I was doing anything wrong :).

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

Re: Life 1.05 to RLE - Help!

Post by Andrew » August 26th, 2011, 6:38 pm

Saving #CXRLE is the recommended setting?
Yep (it's ticked when you first start up Golly). It's needed if you want to save positioning info or a non-zero gen count.
I thought that it was deprecated; at least, someone spent a long time "removing useless #CXRLE comment lines" from the Golly CVS archive.
Certainly not deprecated. It wasn't me who wasted their time removing those lines. :wink:

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

Re: Life 1.05 to RLE - Help!

Post by Andrew » August 26th, 2011, 6:44 pm

Paul Tooke wrote:It also happens when the pattern is pasted into Golly, and therefore has no original filename or extension. Again, the "Save extended RLE" option must be unticked. ...
I can't reproduce this. None of the steps I tried resulted in a "#Life 1.05" line being copied into the rle. Can you describe in more detail exactly what you did? And also let me know which platform you use and which Golly version, just in case they matter. If I can reproduce this problem then I'm more than happy to fix it for the next release.

Paul Tooke
Posts: 111
Joined: May 19th, 2010, 7:35 am
Location: Cambridge, UK

Re: Life 1.05 to RLE - Help!

Post by Paul Tooke » August 27th, 2011, 6:34 am

Andrew wrote:
I can't reproduce this. ... Can you describe in more detail exactly what you did?
Now I can't reproduce it either. Sorry! :oops: I thought that I'd pasted the edited pattern into Golly but it clearly didn't happen that way. The files in my working directory suggest that I invoked the conditions you described. My apologies, I should have known better than to report this alleged behaviour (twice!) without verifying that I could reproduce it. Senility must be creeping in :) .

Nick Gotts
Posts: 5
Joined: September 26th, 2009, 4:38 am

Re: Life 1.05 to RLE - Help!

Post by Nick Gotts » September 10th, 2011, 11:16 am

Remarkably, I've just been faced with the same problem as David - maybe for the same reason. I'm losing access to Windows XP (in favour of Windows 7) and I have a lot of files saved in Johan Bontes' Life32, which won't run on Windows 7, and many are in Life 1.05 format. I tried opening them with Golly, but it fails to register a pattern. I've just looked, at one of these files and found no "#Life 1.05" line. Adding it enabled Golly to open the file. So, thanks very much!

Post Reply