User:Entity Valkyrie 2/StateInvestigator

From LifeWiki
Jump to navigation Jump to search

.rule file

@RULE StateInvestigator
@TABLE
n_states:17
neighborhood:Moore
symmetries:permute
var a1 = {1,2,4,6,8,10,12,15,16}
var a2 = {1,2,4,6,8,10,12,15,16}
var a3 = {1,2,4,6,8,10,12,15,16}
var a4 = {1,2,4,6,8,10,12,15,16}
var b1 = {0,3,5,7,9,11,13}
var b2 = {0,3,5,7,9,11,13}
var b3 = {0,3,5,7,9,11,13}
var b4 = {0,3,5,7,9,11,13}
var b5 = {0,3,5,7,9,11,13}
var b6 = {0,3,5,7,9,11,13}
var b7 = {0,3,5,7,9,11,13}
var c1 = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
var c2 = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
var c3 = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
var c4 = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
var c5 = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
var c6 = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
var c7 = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
var c8 = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
var d1 = {2,3,6,7,14,16}
var d2 = {8,9,12,13,14}
var e1 = {1,2,4,6,8,10,12}
var e2 = {1,2,4,6,8,10,12}
var e3 = {1,2,4,6,8,10,12}
0, 1,a1,a2,b1,b2,b3,b4,b5, 1
0, e1,e2,e3,b1,b2,b3,b4,b5, 1
1, c1,b1,b2,b3,b4,b5,b6,b7, 0
1, a1,a2,a3,a4,c1,c2,c3,c4, 0
1, d1,c1,c2,c3,c4,c5,c6,c7, 0
0, d2,c1,c2,c3,c4,c5,c6,c7, 1
6, c1,c2,c3,c4,c5,c6,c7,c8, 7
7, c1,c2,c3,c4,c5,c6,c7,c8, 6
10, c1,c2,c3,c4,c5,c6,c7,c8, 11
11, c1,c2,c3,c4,c5,c6,c7,c8, 10
12, c1,c2,c3,c4,c5,c6,c7,c8, 13
13, c1,c2,c3,c4,c5,c6,c7,c8, 12
@COLORS
1    0  236   91
2    0  192  254
3  254    0    0
4  254  254  254
5   75   75   75
6  254    0  254
7   64    0  128
8  254  230    0
9  150  128    0
10 130  200    0
11   0  120   40
12 254  140    0  
13 140   70    0
14   0    0  254  
15 192  192  192
16 128  128  128

Explanation of the rule

  • State 0: off cell (evolves like CGoL) #
  • State 1: on cell (evolves like CGoL) #
  • State 2: killer on cell (kills any adjacent cell, treated as on considering births of cells) #
  • State 3: killer off cell (kills any adjacent cell, treated as off considering births of cells) #
  • State 4: eternal on cell #
  • State 5: eternal off cell #
  • State 6: P2 killer on cell (changes into state 7 in next generation)
  • State 7: P2 killer off cell (changes into state 6 in next generation)
  • State 8: egg on cell (gives birth to all neighboring cells unless already on, treated as on considering survival of cells) #
  • State 9: egg off cell (gives birth to all neighboring cells unless already on, treated as off considering survival of cells) #
  • State 10: P2 on cell (changes into state 11 in next generation, not killer, not egg)
  • State 11: P2 off cell (changes into state 10 in next generation, not killer, not egg)
  • State 12: P2 egg on cell (changes into state 13)
  • State 13: P2 egg off cell (changes into state 12)
  • State 14: Inverter (inverts all neighboring cells) #
  • State 15: Catalyst (like state 4, but it can't give birth to cells alone)
  • State 16: Catalyst killer (like state 2, but it can't give birth to cells alone)


States 2-5 never change. States 6-7, 10-11 and 12-13 always toggle.

All states with # are also present in ExtendedLifeFancy.

This rule is really similar to ExtendedLifeFancy. Despite that, StateInvestigator was made totally independent of LifeExtendedFancy when EV2 was searching a rule with multiple states that could allow stable bumpers, bouncers and small and fast syringes.

Versions:

  • 2018 Beta (4 states)
  • 2019 1.0 (6 states)
  • 2019 1.1 (8 states)
  • 2020 2.0 (14 states)
  • 2020 2.1 (17 states)

Pages (page under construction)


x = 141, y = 55, rule = StateInvestigator 102.A2$99.A.3A.A$101.A.A$101.A.A5$9.A30.A30.A2$6.A.3A.A24.A.3A.A24.A. 3A.A$8.A.A28.A.A28.A.A$8.A.A28.A.A28.A.A$93.E17.E2$60.C30.E21.E$81.E 2$E17.E42.E19.E9.E21.E$E7.3A7.E12.E7.3A7.E11.E8.3A8.E9.E9.3A9.E$8.A.A 20.E7.A.A7.E11.E8.A.A8.E19.A.A$8.A.A28.A.A28.A.A28.A.A$63.E15.E10$ 118.2D$45.CD$45.E2$29.A27.E$111.E$5.E23.3A79.E9.2A15.A$4.D22.A.A81.E 9.2A15.A$3.DEA2.3A18.3A68.CD9.E26.3A$4.D3.A.A33.3A53.E39.A$8.A.A18.A 14.A.A$44.A.A37.A27.E2$84.3A$82.A.A37.C$84.3A$99.3A21.C$84.A14.A.A$ 99.A.A19.E3$117.B! #C [[ THUMBSIZE 2 THEME 6 GRID GRIDMAJOR 0 SUPPRESS THUMBLAUNCH ]] #C [[ THEME 6 HEIGHT 640 WIDTH 1000 ZOOM 6 ]]
Some pi conduits (click above to open LifeViewer)
x = 141, y = 53, rule = StateInvestigator x = 104, y = 143, rule = StateInvestigator 54.3C.3C.3C$56.C.C.C3.C$54.3C.C.C2.2C$54.C3.C.C3.C$54.3C.3C.3C6$81.2C 2.3C$.3C5.3C6.3C9.3C.2C46.C2.C.C$.C7.C10.C11.C2.C46.C2.3C$.3C5.3C8.C 9.3C2.C46.C4.C$.C.C5.C.C8.C11.C2.C45.3C.3C$.3C5.3C8.C9.3C.3C5$76.2A 10.2A$77.A10.A$77.A10BA$.3B5.4B5.5B7.A8BA14.9B14.A10.A$76.2A10.2A21$ 53.2C2.3C22.3C.3C$25.3C.3C22.C2.C.C24.C.C.C$27.C.C.C22.C2.3C24.C.C.C$ 3.3C.3C15.3C.C.C22.C2.C.C24.C.C.C$5.C.C.C15.C3.C.C21.3C.3C24.C.3C$3. 3C.3C15.3C.3C$5.C.C.C$3.3C.3C4$55.A2.A$54.A4.A2$20.2A12.2A$12B8.16B 12.18B10.4A12.4A$20.2A12.2A40.20B$76.4A12.4A$54.A4.A$55.A2.A17$37.C.C .3C40.3C.3C$12.3C.3C18.C.C.C44.C3.C$14.C3.C18.3C.3C40.3C.3C$12.3C3.C 20.C.C.C40.C3.C$12.C5.C20.C.3C40.3C.3C$12.3C3.C8$38.6A14.6A14.A18.A$ 46.A3.2A3.A28.8A$11.A7.A16.A28BA6.32B$46.A3.2A3.A28.8A$3.A23BA10.6A 14.6A14.A18.A2$11.A7.A20$15.2C2.C.C.2C$16.C2.C.C2.C$16.C2.3C2.C$16.C 4.C2.C$15.3C3.C.3C16$4.A4.6A11.6A4.A$4.33B$4.A4.6A11.6A4.A! #C [[ THUMBSIZE 2 THEME 6 GRID GRIDMAJOR 0 SUPPRESS THUMBLAUNCH ]] #C [[ THEME 6 HEIGHT 640 WIDTH 640 ZOOM 4 ]]
Some oscillators on 1-cell-thick state 2 lines
(click above to open LifeViewer)
x = 106, y = 73, rule = StateInvestigator 95.E$94.3D$94.EAE$89.2D9.2D$89.E11.E5$35.DE$35.AD2$33.A$29.DCEA.A$29. E3.2A2.2A53.2A3.2A$3.GEDEG29.2A52.A.A3.A.A$3.E.D.E59.E23.A7.A$4.A61. 3D22.A.A3.A.A$4.A20.2A5.A9.ED22.EAE23.2A3.2A$4.A3.A16.2A3.2A5.A5.C17. 2D9.2D$4.A15.ED9.2A3.2A5.E17.E11.E11.3A15.3A$4.A15.DA14.A.A4.A$3.E.D. E16.2A16.A.A47.2A3.2A$3.GEDEG15.A.A16.2A47.A.A3.A.A$24.A4.A.A14.AD43. A7.A$24.E5.2A3.2A9.DE43.A.A3.A.A$24.C5.A5.2A3.2A49.2A3.2A$24.DE9.A5. 2A3$3.GEDEG21.2A33.2A3.2A$3.E.D.E21.2A2.2A3.E24.A.A3.A.A$4.A28.A.AECD 24.A7.A$4.A29.A28.A.A3.A.A$4.A3.A55.2A3.2A$4.A3.A22.DA$4.A26.ED24.3A 15.3A$4.A$3.E.D.E56.2A3.2A$3.GEDEG55.A.A3.A.A$63.A7.A$63.A.A3.A.A$64. 2A3.2A4$3.FEDEF84.2A3.2A$3.EAD.E83.A.A3.A.A$4.2A85.A7.A$3.3A85.A.A3.A .A$.2A.2A3.A18.2D62.2A3.2A$3A.2A3.3A16.2A$.2A.2A3.A51.E11.E11.3A15.3A $3.3A55.2D9.2D$4.2A60.EAE23.2A3.2A$3.EAD.E16.C41.3D22.A.A3.A.A$3.FEDE F16.2D9.2D30.E23.A7.A$30.A.A3.C54.A.A3.A.A$31.2A59.2A3.2A$31.A2$31.2A $31.2D6$89.E11.E$89.2D9.2D$94.EAE$94.3D$95.E! #C [[ THUMBSIZE 2 THEME 6 GRID GRIDMAJOR 0 SUPPRESS THUMBLAUNCH ]] #C [[ THEME 6 HEIGHT 600 WIDTH 720 ZOOM 6 ]]
three P4 sparkers,
P23 and P34 glider shuttles,
extensible P41 oscillator
(click above to open LifeViewer)
x = 50, y = 468, rule = StateInvestigator 15.2D$15.2A2$15.A10.C.A$15.2A8.E2.2A$9.C4.A.A9.2A.A$33.D$4.DE4.E22.D$ 4.C27.3E$4.E15.E.E3.2A.A4.2A$4.A12.E10.2A4.2A$3.A.A9.2D9.C.A10.DE$4. 2A33.AD$DA33.2A$ED10.A.C9.2D9.A.A$5.2A4.2A10.E12.A$5.2A4.A.2A3.E.E15. E$6.3E27.C$7.D22.E4.ED$7.D$11.A.2A9.A.A4.C$11.2A2.E8.2A$12.A.C10.A2$ 24.2A$24.2D23$16.2D$16.2A2$16.A10.C.2A$16.2A8.E3.2A$10.C4.A.A11.A$34. D$11.E22.D$4.DE27.3E$4.C16.E.E5.A5.2A$4.E13.E11.2A3.2A$4.A11.2D9.C.2A 9.DE$3.A.A34.AD$4.2A30.2A$DA34.A.A$ED9.2A.C9.2D11.A$5.2A3.2A11.E13.E$ 5.2A5.A5.E.E16.C$6.3E27.ED$7.D22.E$7.D$12.A11.A.A4.C$10.2A3.E8.2A$11. 2A.C10.A2$24.2A$24.2D22$17.2D$17.2A$31.A$17.A10.C2.2A$17.2A8.E2.A.A$ 11.C4.A.A$35.D$12.E22.D$34.3E$4.DE16.E.E11.2A$4.C14.E10.A.A3.2A$4.E 12.2D9.C2.2A8.DE$4.A26.A9.AD$3.A.A31.2A$4.2A31.A.A$DA9.A26.A$ED8.2A2. C9.2D12.E$5.2A3.A.A10.E14.C$5.2A11.E.E16.ED$6.3E$7.D22.E$7.D$24.A.A4. C$10.A.A2.E8.2A$10.2A2.C10.A$11.A$24.2A$24.2D21$18.2D$18.2A$32.2A$18. A10.C3.2A$18.2A8.E3.A$12.C4.A.A$36.D$13.E22.D$35.3E$23.E.E11.2A$4.DE 14.E11.A4.2A$4.C13.2D9.C3.2A7.DE$4.E27.2A8.AD$4.A33.2A$3.A.A32.A.A$4. 2A33.A$DA8.2A27.E$ED7.2A3.C9.2D13.C$5.2A4.A11.E14.ED$5.2A11.E.E$6.3E$ 7.D22.E$7.D$24.A.A4.C$11.A3.E8.2A$9.2A3.C10.A$10.2A$24.2A$24.2D20$19. 2D$19.2A13.A$34.2A$19.A10.C2.A.A$19.2A8.E$13.C4.A.A$37.D$14.E22.D$36. 3E$24.E.E11.2A$21.E16.2A$4.DE13.2D9.C2.A.A7.DE$4.C29.2A7.AD$4.E29.A4. 2A$4.A34.A.A$3.A.A34.A$4.2A4.A29.E$DA7.2A29.C$ED7.A.A2.C9.2D13.ED$5. 2A16.E$5.2A11.E.E$6.3E$7.D22.E$7.D$24.A.A4.C$15.E8.2A$9.A.A2.C10.A$9. 2A$10.A13.2A$24.2D19$20.2D$20.2A13.2A$36.2A$20.A10.C3.A$20.2A8.E$14.C 4.A.A$38.D$15.E22.D$37.3E$25.E.E11.2A$22.E16.2A$20.2D9.C3.A8.DE$4.DE 30.2A6.AD$4.C30.2A3.2A$4.E35.A.A$4.A36.A$3.A.A35.E$4.2A3.2A30.C$DA6. 2A30.ED$ED8.A3.C9.2D$5.2A16.E$5.2A11.E.E$6.3E$7.D22.E$7.D$24.A.A4.C$ 15.E8.2A$10.A3.C10.A$8.2A$9.2A13.2A$24.2D18$21.2D14.A$21.2A14.2A$36.A .A$21.A10.C$21.2A8.E$15.C4.A.A$39.D$16.E22.D$38.3E$26.E.E11.2A$23.E 16.2A$21.2D9.C12.DE$36.A.A6.AD$4.DE31.2A2.2A$4.C32.A3.A.A$4.E37.A$4.A 37.E$3.A.A3.A32.C$4.2A2.2A31.ED$DA6.A.A$ED12.C9.2D$5.2A16.E$5.2A11.E. E$6.3E$7.D22.E$7.D$24.A.A4.C$15.E8.2A$14.C10.A$8.A.A$8.2A14.2A$9.A14. 2D17$22.2D14.2A$22.2A15.2A$38.A$22.A10.C$22.2A8.E$16.C4.A.A$40.D$17.E 22.D$39.3E$27.E.E11.2A$24.E16.2A$22.2D9.C12.DE$38.A7.AD$39.2A.2A$4.DE 32.2A2.A.A$4.C38.A$4.E38.E$4.A38.C$3.A.A2.2A32.ED$4.2A.2A$DA7.A$ED12. C9.2D$5.2A16.E$5.2A11.E.E$6.3E$7.D22.E$7.D$24.A.A4.C$15.E8.2A$14.C10. A$9.A$7.2A15.2A$8.2A14.2D15$40.A$23.2D15.2A$23.2A14.A.A2$23.A10.C$23. 2A8.E$17.C4.A.A$41.D$18.E22.D$40.3E$28.E.E11.2A$25.E16.2A$23.2D9.C12. DE$41.3A3.AD$39.A4.A$40.A4.A$4.DE34.5A$4.C39.E$4.E39.C$4.5A34.ED$3.A 4.A$4.A4.A$DA3.3A$ED12.C9.2D$5.2A16.E$5.2A11.E.E$6.3E$7.D22.E$7.D$24. A.A4.C$15.E8.2A$14.C10.A2$7.A.A14.2A$7.2A15.2D$8.A13$41.2A$24.2D16.2A $24.2A15.A2$24.A10.C$24.2A8.E$18.C4.A.A$42.D$19.E22.D$41.3E$29.E.E11. 2A$26.E15.A.A$24.2D9.C6.A5.DE$41.A3.A2.AD$40.2A3.A$40.A5.A$40.A4.A$4. DE35.A3.E$4.C2A36.2AC$4.E3.A35.ED$4.A4.A$3.A5.A$4.A3.2A$DA2.A3.A$ED5. A6.C9.2D$5.A.A15.E$5.2A11.E.E$6.3E$7.D22.E$7.D$24.A.A4.C$15.E8.2A$14. C10.A2$8.A15.2A$6.2A16.2D$7.2A! #C [[ THUMBSIZE 2 THEME 6 GRID GRIDMAJOR 0 SUPPRESS THUMBLAUNCH ]] #C [[ THEME 6 HEIGHT 1000 WIDTH 480 ZOOM 2 ]]
45+2n gun collection
(click above to open LifeViewer)
x = 19, y = 79, rule = StateInvestigator 11.C3$4.D$4.D9.AD$5.E8.AD2$6.E4.E2$4.E4.E$5.A$DA.2A5.E$DA2.2A5.D$11.D 3$4.C14$12.C3$5.D$5.D9.AD$6.E8.AD2$12.E$6.E$10.E$4.E$5.A$DA.2A5.E$DA 2.2A5.D$11.D3$4.C13$13.C3$6.D$6.D9.AD$7.E8.AD2$13.E2$6.E4.E2$4.E$5.A$ DA.2A5.E$DA2.2A5.D$11.D3$4.C! #C [[ THUMBSIZE 2 THEME 6 GRID GRIDMAJOR 0 SUPPRESS THUMBLAUNCH ]] #C [[ THEME 6 HEIGHT 640 WIDTH 480 ZOOM 6 ]]
66+8n gun collection
(click above to open LifeViewer)


x = 190, y = 12, rule = StateInvestigator 3.A10.2A14.A10.2A15.A12.2A12.E3.E2.E12.2A18.A17.2A17.A21.2A$.E3.E6.E 4.E10.E3.E6.E4.E11.E3.E8.E4.E27.2E4.2E12.2E3.2E11.2E4.E12.2E3.2E15.2E 4.E$EA3.AE4.EA4.AE8.E5.E4.E6.E10.D3.D8.D4.D8.C2D6.2DC$DE3AED4.DE4AED 8.D5.D4.D6.D10.D3.D8.D4.D10.CD.2B.DC7.C2D6.2DC8.C2D5.2DC7.C2D5.2DC8.C 2D5.2DC11.C2D5.2DC$.EC.CE6.EC2.CE9.E5AE4.E6AE11.EBE10.E2BE12.C.2E.C 10.CD.2B.DC12.CD.B.DC11.CD.B.DC12.CD.B.DC15.CD.B.DC$28.E3.E6.E4.E43. 2A13.C.2E.C14.C.E.C13.C.E.C14.C.E.E17.C.E.E$88.2D15.2A56.2A20.2A$105. 2D17.3AE14.3AE17.2A20.2A$123.4ADE12.4ADE14.B4.B16.B4.B$122.A.A2.2D11. A.A2.2D14.A4B17.A4B$122.2A4.A11.2A4.A18.A21.A$161.B2.D18.B2.D! #C [[ THUMBSIZE 2 THEME 6 GRID GRIDMAJOR 0 SUPPRESS THUMBLAUNCH ]] #C [[ THEME 6 HEIGHT 320 WIDTH 1200 ZOOM 6 ]]
Period 3-8 strong dot and domino sparkers (click above to open LifeViewer)
x = 117, y = 71, rule = StateInvestigator 8.E2$10.E2$12.ED$13.E5$C2$4.B2.D$4.E3.C$7.D2.E.EC5.C5.C5.C5.C5.C5.C 17.C5.C5.C5.C5.C5.C5.CE.E2.D$6.C3.DE.D5.D5.D5.D5.D5.D5.D17.D5.D5.D5.D 5.D5.D5.D.ED3.C$10.2E.DC4.DC4.DC4.DC4.DC4.DC4.DC15.CD4.CD4.CD4.CD4.CD 4.CD4.CD.2E$7.BD.2E2.DC4.DC4.DC4.DC4.DC4.DC4.DC2.C7.C2.CD4.CD4.CD4.CD 4.CD4.CD4.CD2.2E.DB$7.ED44.D2.BE.EB2.D44.DE$8.CE4.BE4.B2E3.BE4.B2E3.B E4.B2E3.BE4.2DC2D4.EB3.2EB3.2EB3.2EB3.2EB3.2EB3.2EB4.EC$7.ED49.E49.DE $7.BD.2E2.DC4.DC4.DC4.DC4.DC4.DC4.DC.ED2E3.2EDE.CD4.CD4.CD4.CD4.CD4.C D4.CD2.2E.DB$10.2E.DC4.DC4.DC4.DC4.DC4.DC4.DC3.3E3.3E3.CD4.CD4.CD4.CD 4.CD4.CD4.CD.2E$6.C3.DE.D5.D5.D5.D5.D5.D5.D3.E9.E3.D5.D5.D5.D5.D5.D5. D.ED3.C$7.D2.E.EC5.C5.C5.C5.C5.C5.C3.C2D5.2DC3.C5.C5.C5.C5.C5.C5.CE.E 2.D$4.E3.C46.CD.B.DC46.C3.E$4.B2.D48.C.E.C48.D2.B2$C115.C2$53.C2D5.2D C$55.CD.B.DC$56.C.E.C$13.E89.E$12.ED89.DE2$10.E42.C2D5.2DC42.E$55.CD. B.DC$8.E47.C.E.C47.E4$53.C2D5.2DC$55.CD.B.DC$56.C.E.C4$53.C2D5.2DC$ 55.CD.B.DC$56.C.E.C4$53.C2D5.2DC$55.CD.B.DC$56.C.E.C4$53.C2D5.2DC$55. CD.B.DC$56.C.E.C$57.E.E5$63.A$62.2A$62.A.A! #C [[ THUMBSIZE 2 THEME 6 GRID GRIDMAJOR 0 SUPPRESS THUMBLAUNCH ]] #C [[ THEME 6 HEIGHT 500 WIDTH 1000 ZOOM 6 ]]
lightspeed and (6,0)/7 signals. These signals are interchangeable to vary speed and period.
(click above to open LifeViewer)
x = 117, y = 71, rule = StateInvestigator x = 31, y = 31, rule = StateInvestigator 28.A.A$28.2A$29.A10$16.A$16.A.A$16.2A8$.E2$E4.A9.E$DA.2A14.A$DA2.2A 11.3A$2E15.A$17.A2$5.E! #C [[ THUMBSIZE 2 THEME 6 GRID GRIDMAJOR 0 SUPPRESS THUMBLAUNCH ]] #C [[ THEME 6 HEIGHT 320 WIDTH 480 ZOOM 6 ]]
Smallest G-to-H known. Repeat time 49.
(click above to open LifeViewer)

StateInvestigator-ExtendedLifeFancy conversion (section outdated)

States 0 to 5 also exist in ExtendedLifeFancy. The only difference are the colors and the fact that states 2 and 4 in StateInvestigator become states 8 and 6 (respectively) in ExtendedLifeFancy. States 6 and 7 can't be converted to ExtendedLifeFancy. Despite the similarity, StateInvestigator was made completely independent of ExtendedLifeFancy.

Scripts (lua, based on invert.lua, only supports states 0 to 5 in StateInvestigator):

-- StateInvestigator to ExtendedLifeFancy
local g = golly()
local gp = require "gplus"
-- re-assigning inner loop functions results in a 10% speed up
local setcell = g.setcell
local getcell = g.getcell
local r = gp.rect(g.getselrect())
if r.empty then g.exit("There is no selection.") end
-- local t1 = os.clock() 
local oldsecs = os.clock()
for row = r.top, r.bottom do
    -- if large selection then give some indication of progress
    local newsecs = os.clock()
    if newsecs - oldsecs >= 1.0 then
        oldsecs = newsecs
        g.update()
    end
    for col = r.left, r.right do
        if g.getcell(col, row) == 2 then
           g.setcell(col, row, 8)
        elif g.getcell(col, row) == 4 then
           g.setcell(col, row, 6) 
        elseif g.getcell(col, row) > 5 then
           error("Invalid state")
        end
    end
end
if not r.visible() then g.fitsel() end
-- g.show(""..(os.clock()-t1))
g.setrule("ExtendedLifeFancy")
-- ExtendedLifeFancy to StateInvestigator
local g = golly()
local gp = require "gplus"
-- re-assigning inner loop functions results in a 10% speed up
local setcell = g.setcell
local getcell = g.getcell
local r = gp.rect(g.getselrect())
if r.empty then g.exit("There is no selection.") end
-- local t1 = os.clock() 
local oldsecs = os.clock()
for row = r.top, r.bottom do
    -- if large selection then give some indication of progress
    local newsecs = os.clock()
    if newsecs - oldsecs >= 1.0 then
        oldsecs = newsecs
        g.update()
    end
    for col = r.left, r.right do
        if g.getcell(col, row) == 6 then
           g.setcell(col, row, 4)
        elseif g.getcell(col, row) == 8 then
           g.setcell(col, row, 2)
        elseif g.getcell(col, row) > 8 then
           error("Invalid state")
        elseif g.getcell(col, row) == 7 then
           error("Invalid state")
        elseif g.getcell(col, row) == 4 then
           error("Invalid state")
        end
    end
end
if not r.visible() then g.fitsel() end
-- g.show(""..(os.clock()-t1))
g.setrule("StateInvestigator")