Minigame sort of thing

A forum where anything goes. Introduce yourselves to other members of the forums, discuss how your name evolves when written out in the Game of Life, or just tell us how you found it. This is the forum for "non-academic" content.
User avatar
Hdjensofjfnen
Posts: 1743
Joined: March 15th, 2016, 6:41 pm
Location: re^jθ

Minigame sort of thing

Post by Hdjensofjfnen » August 13th, 2016, 3:10 pm

So here's how it goes:

You have 96 hours (4 days) to find the cheapest glider destruction for this pattern:

Code: Select all

x = 7, y = 5, rule = B3/S23
2o4bo$ob4o$o3bo$4bo$2b2o!
The person with the cheapest destruction makes the next pattern.

Edit: Pattern must be 16x16 or less
Last edited by Hdjensofjfnen on August 13th, 2016, 9:17 pm, edited 1 time in total.

Code: Select all

x = 5, y = 9, rule = B3-jqr/S01c2-in3
3bo$4bo$o2bo$2o2$2o$o2bo$4bo$3bo!

Code: Select all

x = 7, y = 5, rule = B3/S2-i3-y4i
4b3o$6bo$o3b3o$2o$bo!

Gamedziner
Posts: 795
Joined: May 30th, 2016, 8:47 pm
Location: Milky Way Galaxy: Planet Earth

Re: Minigame sort of thing

Post by Gamedziner » August 13th, 2016, 3:27 pm

Two gliders:

Code: Select all

6bo$7bo$5b3o4$12b2o4bo$12bob4o$12bo3bo$16bo$14b2o28$3o$2bo$bo!
(I got lucky.)

Code: Select all

x = 81, y = 96, rule = LifeHistory
58.2A$58.2A3$59.2A17.2A$59.2A17.2A3$79.2A$79.2A2$57.A$56.A$56.3A4$27.
A$27.A.A$27.2A21$3.2A$3.2A2.2A$7.2A18$7.2A$7.2A2.2A$11.2A11$2A$2A2.2A
$4.2A18$4.2A$4.2A2.2A$8.2A!

GUYTU6J
Posts: 2200
Joined: August 5th, 2016, 10:27 am
Location: 拆哪!I repeat, CHINA! (a.k.a. 种花家)
Contact:

Re: Minigame sort of thing

Post by GUYTU6J » August 13th, 2016, 9:48 pm

You need to disallow to use scripts.

Code: Select all

x = 7, y = 10, rule = B3/S23
bo$2bo$3o3$2o4bo$ob4o$o3bo$4bo$2b2o!

User avatar
blah
Posts: 311
Joined: April 9th, 2016, 7:22 pm

Re: Minigame sort of thing

Post by blah » August 14th, 2016, 2:40 am

Code: Select all

x = 10, y = 6, rule = B3/S23
3b2o4bo$3bob4o$3bo3bo$bo5bo$b2o2b2o$obo!
This one takes 11 generations, with one glider. Does it count, or is the glider too close?
It's easy to find these anyway:

Code: Select all

x = 53, y = 15, rule = B3/S23
40bo$41bo$39b3o5$2o4bo11b2o4bo7b2o4bo7b2o4bo$ob4o12bob4o8bob4o8bob4o$o
3bo10bo2bo3bo9bo3bo9bo3bo$4bo10b2o5bo13bo13bo$2b2o3b2o5bobo3b2o12b2o
12b2o$6b2o22b3o$8bo23bo$31bo!
succ

drc
Posts: 1664
Joined: December 3rd, 2015, 4:11 pm

Re: Minigame sort of thing

Post by drc » August 14th, 2016, 4:20 am

0 gliders :lol: :

Code: Select all

x = 12, y = 5, rule = B3/S23
5b2o4bo$o4bob4o$o4bo3bo$o8bo$7b2o!

GUYTU6J
Posts: 2200
Joined: August 5th, 2016, 10:27 am
Location: 拆哪!I repeat, CHINA! (a.k.a. 种花家)
Contact:

Re: Minigame sort of thing

Post by GUYTU6J » August 14th, 2016, 4:52 am

1 dot :D

Code: Select all

x = 7, y = 6, rule = B3/S23
bo$2o4bo$ob4o$o3bo$4bo$2b2o!

Code: Select all

x = 9, y = 6, rule = B3/S23
o$2b2o4bo$2bob4o$2bo3bo$6bo$4b2o!
Last edited by GUYTU6J on August 14th, 2016, 7:09 am, edited 1 time in total.

GUYTU6J
Posts: 2200
Joined: August 5th, 2016, 10:27 am
Location: 拆哪!I repeat, CHINA! (a.k.a. 种花家)
Contact:

Re: Minigame sort of thing

Post by GUYTU6J » August 14th, 2016, 4:56 am

Just change rule:the pattern dies out in 3-4 Life,Diamoeba,Move

Code: Select all

x = 7, y = 5, rule = B34/S34
2o4bo$ob4o$o3bo$4bo$2b2o!

Code: Select all

x = 7, y = 5, rule = B35678/S5678
2o4bo$ob4o$o3bo$4bo$2b2o!

Code: Select all

x = 7, y = 5, rule = B368/S245
2o4bo$ob4o$o3bo$4bo$2b2o!

In Lifehistory,1 gray dot

Code: Select all

x = 17, y = 5, rule = LifeHistory
2A4.A3.2A4.A$A.4A4.A.4A$A2.FA5.A3.A$4.A5.F3.A$2.2A8.2A!

drc
Posts: 1664
Joined: December 3rd, 2015, 4:11 pm

Re: Minigame sort of thing

Post by drc » August 14th, 2016, 5:37 am

or make it a torus:

Code: Select all

x = 7, y = 5, rule = B3/S23:T10,10
2o4bo$ob4o$o3bo$4bo$2b2o!

GUYTU6J
Posts: 2200
Joined: August 5th, 2016, 10:27 am
Location: 拆哪!I repeat, CHINA! (a.k.a. 种花家)
Contact:

Re: Minigame sort of thing

Post by GUYTU6J » August 14th, 2016, 6:24 am

If you mark this pattern in Lifehistory and let it go,you will see that finally every marked cells are OFF

Code: Select all

x = 7, y = 5, rule = LifeHistory
2C4.C$C.4C$C3.C$4.C$2.2C!

Can somebody find a spaceship that contains this part?

User avatar
Hdjensofjfnen
Posts: 1743
Joined: March 15th, 2016, 6:41 pm
Location: re^jθ

Re: Minigame sort of thing

Post by Hdjensofjfnen » August 14th, 2016, 2:07 pm

CLARIFICATION:

NO SCRIPTS.
GLIDERS ONLY.
IN LIFE ONLY. (LifeHistory ok, but no grey blocks)
Technically, this is spoiled, so new pattern:

Code: Select all

x = 6, y = 6, rule = B3/S23
bo$2o$4bo$3b3o$b3obo$5bo!

Code: Select all

x = 5, y = 9, rule = B3-jqr/S01c2-in3
3bo$4bo$o2bo$2o2$2o$o2bo$4bo$3bo!

Code: Select all

x = 7, y = 5, rule = B3/S2-i3-y4i
4b3o$6bo$o3b3o$2o$bo!

User avatar
Scorbie
Posts: 1692
Joined: December 7th, 2013, 1:05 am

Re: Minigame sort of thing

Post by Scorbie » August 14th, 2016, 9:37 pm

1G

Code: Select all

x = 20, y = 12, rule = B3/S23
18bo$17bo$17b3o4$bo$2o$4bo$3b3o$b3obo$5bo!

User avatar
blah
Posts: 311
Joined: April 9th, 2016, 7:22 pm

Re: Minigame sort of thing

Post by blah » August 15th, 2016, 1:21 am

1G, but faster.

Code: Select all

x = 9, y = 9, rule = B3/S23
bo$2o$4bo$3b3o$b3obo$5bo$7bo$6b2o$6bobo!
succ

Sphenocorona
Posts: 549
Joined: April 9th, 2013, 11:03 pm

Re: Minigame sort of thing

Post by Sphenocorona » August 15th, 2016, 3:36 am

blah wrote:1G, but faster.
I'd argue that that's too close to the pattern, it almost certainly would have interacted already in any predecessor pattern sequence. The glider should be at least be separated so it won't interact immediately I think.

wildmyron
Posts: 1544
Joined: August 9th, 2013, 12:45 am
Location: Western Australia

Re: Minigame sort of thing

Post by wildmyron » August 15th, 2016, 4:10 am

Sphenocorona wrote:
blah wrote:1G, but faster.
I'd argue that that's too close to the pattern, it almost certainly would have interacted already in any predecessor pattern sequence. The glider should be at least be separated so it won't interact immediately I think.
Not to make any suggestions about the rules for this game, but the above solution needn't have come from an interacting predecessor:

Code: Select all

x = 12, y = 11
bbo$bboboo$4bo$3bo4bo$o4bo$boboobboo$bboobbo$bbobo$10bo$9boo$9bobo!
The 5S project (Smallest Spaceships Supporting Specific Speeds) is now maintained by AforAmpere. The latest collection is hosted on GitHub and contains well over 1,000,000 spaceships.

Semi-active here - recovering from a severe case of LWTDS.

User avatar
Rhombic
Posts: 1072
Joined: June 1st, 2013, 5:41 pm

Re: Minigame sort of thing

Post by Rhombic » August 15th, 2016, 6:46 am

This game is really interesting! Let's see if I chip in for the next round because the perfect solution has already been discovered.

EDIT: Shall we create a special variant with scripts allowed? Some patterns could potentially be difficult even with scripts, and as long as people use different scripts it could be possible:

Code: Select all

x = 43, y = 45, rule = Life
12b2o10b2o$b2o8bobo9bo2bo$bobo6bobo6b2obob2o$4bo3b3o7bobobobo6bo$2b2o
3bo3bo6bo2bo2bo5bobo$bo6bobobo3b3o3b2o3bo2bobo2bo$b3o3b2obobo2bo11b3ob
ob3o$4bo2bo2bobobobo14bo$3bobobob2obo2bobo3b2ob2o3b2ob2o3b2o$2bobo2bo
2bobo4bo2bobobo3bo2bo2bobobo$2bo4b2o2bo5b4obo2bo2b2obob2obobob2o$b2o
20b3o5bo4bo2bo2bo$17b2o9b2obob2ob2obob2o$b2o7b2ob2o2bo5b2obo2bobob2obo
2bobo$obo6bobobo5bo2bobob2o2bo5bobo2bo$o2b2o4bobo2b6o2bobobo9b2o3b2o$b
2o2bo4b2o11bo3bo4bo$3b2o11b4o4b4o3bobo2b4o$3bo4b4o3bo3bo10bo2bo2bo2bo$
5bo2bo3bo3bo5b3ob2o2bobob2o$4b2o3b2obo2b2o4bo2bobo4b2obo$10bob2o3b2obo
bo2bo2bo5bo$2b4o4bo6bob2ob2obob2o2b2ob2o$2bo2bo5b3o9bobo6bo4bo$6b2o5bo
4b5o3b3o3bob4o$7bo9bo2bo7bo4bo$7bob2o6b2o9bobo3b2o$6b2obo9b4o3b2obobo
4bo$10bo6b2o2bobobobo2bo3b3o$11bo4bobo4bobo2b2o3bo$5bo2b4o4b2o5bobo7b
2o$5b4o13b2ob5o5bo$10b2o4b4o9bo3b2obo$5b2o4bo4bo2bo2b5o5bo3bo$5bobo3bo
b2obo2bobo4bo4bob3o$7bo2b2ob2ob4ob2o2bo5bobo$6b2obo14bob3o3bo$7bo2b2ob
2ob2ob5obo2bo$5bobo3bob2ob2obo3bo3bo$5b2o4bo8b2o2bo3b3o$10b2o10b2o6bo$
20b2o$20bo2b3o$22b2o2bo$25b2o!
SoL : FreeElectronics : DeadlyEnemies : 6a-ite : Rule X3VI
what is “sesame oil”?

User avatar
Rhombic
Posts: 1072
Joined: June 1st, 2013, 5:41 pm

Re: Minigame sort of thing

Post by Rhombic » August 31st, 2016, 11:42 am

GUYTU6J wrote:You need to disallow to use scripts.

Code: Select all

x = 7, y = 10, rule = B3/S23
bo$2bo$3o3$2o4bo$ob4o$o3bo$4bo$2b2o!

Could you post the script you used?
SoL : FreeElectronics : DeadlyEnemies : 6a-ite : Rule X3VI
what is “sesame oil”?

GUYTU6J
Posts: 2200
Joined: August 5th, 2016, 10:27 am
Location: 拆哪!I repeat, CHINA! (a.k.a. 种花家)
Contact:

Re: Minigame sort of thing

Post by GUYTU6J » September 2nd, 2016, 9:42 am

Rhombic wrote:
GUYTU6J wrote:You need to disallow to use scripts.

Code: Select all

x = 7, y = 10, rule = B3/S23
bo$2bo$3o3$2o4bo$ob4o$o3bo$4bo$2b2o!

Could you post the script you used?

Code: Select all

# glider_destruction.py

import golly as g
from operator import mul

glider = [[-1, -2, 0, -1, -2, 0, -1, 0, 0, 0], [-2, -2, -1, -1, 0, -1, -2, 0, -1, 0], [-1, -2, -3, -1, -1, -1, -2, 0, -1, 0], [-3, -2, -1, -2, -2, -1, -1, -1, -2, 0]]

collstatus = (10 ** 9, 0, 0, [0, 0]) #(dummy values) box_size, pattern_pos, glider_phase, [glider_x, glider_y]

def form(celllist, num):
   if num not in xrange(8):
      return celllist
   if num >= 4:
      celllist = g.transform(celllist, 0, 0, -1, 0, 0, -1)
      num -= 4
   if num >= 2:
      celllist = g.transform(celllist, 0, 0, 0, 1, -1, 0)
      num -= 2
   if num >= 1:
      celllist = g.transform(celllist, 0, 0, -1, 0, 0, 1)
   return celllist

def trygliders(celllist, distance, num):
   g.new('')
   g.putcells(celllist)
   rect = g.getrect()
   gx = rect[0] - 3 - distance
   gy = rect[1] - 3 - distance
   status = collstatus
   phase = 0
   for gphase in glider:
      for w in xrange(rect[2] + 5):
         g.new('')
         g.putcells(celllist)
         g.putcells(gphase, gx + w, gy)
         for gen in xrange(1000):
            g.run(1)
            if int(g.getpop()) <= 2:
               return (0, num, phase, [gx + w, gy])
         box = reduce(mul, g.getrect()[2:])
         if box < status[0]:
            status = (box, num, phase, [gx + w, gy])
      phase += 1
   return status

glidersexist = (g.evolve([-1, -2, 0, -1, -2, 0, -1, 0, 0, 0], 4) == [0, -1, 1, 0, -1, 1, 0, 1, 1, 1])
if not glidersexist:
   g.exit("Please choose a rule where gliders exist.")

celllist = g.getcells(g.getrect())
dist = 0
g.show("Searching for a 1-glider destruction... press any key to display smallest result found")
while True:
   for num in xrange(8):
      tlist = form(celllist, num)
      collstatus = trygliders(tlist, dist, num)
      event = g.getevent()
      if collstatus[0] == 0 or event.startswith("key"):
         if collstatus[0] == 0:
            g.show("Found clean glider destruction.")
         else:
            g.show("Found result with %d-cell bounding box." % collstatus[0])
         g.new('')
         g.putcells(form(celllist, collstatus[1]))
         g.putcells(glider[collstatus[2]], collstatus[3][0], collstatus[3][1])
         g.exit()
   dist += 1

User avatar
Rhombic
Posts: 1072
Joined: June 1st, 2013, 5:41 pm

Re: Minigame sort of thing

Post by Rhombic » September 3rd, 2016, 9:58 am

GUYTU6J wrote:

Code: Select all

# glider_destruction.py

import golly as g
from operator import mul

glider = [[-1, -2, 0, -1, -2, 0, -1, 0, 0, 0], [-2, -2, -1, -1, 0, -1, -2, 0, -1, 0], [-1, -2, -3, -1, -1, -1, -2, 0, -1, 0], [-3, -2, -1, -2, -2, -1, -1, -1, -2, 0]]

collstatus = (10 ** 9, 0, 0, [0, 0]) #(dummy values) box_size, pattern_pos, glider_phase, [glider_x, glider_y]

def form(celllist, num):
   if num not in xrange(8):
      return celllist
   if num >= 4:
      celllist = g.transform(celllist, 0, 0, -1, 0, 0, -1)
      num -= 4
   if num >= 2:
      celllist = g.transform(celllist, 0, 0, 0, 1, -1, 0)
      num -= 2
   if num >= 1:
      celllist = g.transform(celllist, 0, 0, -1, 0, 0, 1)
   return celllist

def trygliders(celllist, distance, num):
   g.new('')
   g.putcells(celllist)
   rect = g.getrect()
   gx = rect[0] - 3 - distance
   gy = rect[1] - 3 - distance
   status = collstatus
   phase = 0
   for gphase in glider:
      for w in xrange(rect[2] + 5):
         g.new('')
         g.putcells(celllist)
         g.putcells(gphase, gx + w, gy)
         for gen in xrange(1000):
            g.run(1)
            if int(g.getpop()) <= 2:
               return (0, num, phase, [gx + w, gy])
         box = reduce(mul, g.getrect()[2:])
         if box < status[0]:
            status = (box, num, phase, [gx + w, gy])
      phase += 1
   return status

glidersexist = (g.evolve([-1, -2, 0, -1, -2, 0, -1, 0, 0, 0], 4) == [0, -1, 1, 0, -1, 1, 0, 1, 1, 1])
if not glidersexist:
   g.exit("Please choose a rule where gliders exist.")

celllist = g.getcells(g.getrect())
dist = 0
g.show("Searching for a 1-glider destruction... press any key to display smallest result found")
while True:
   for num in xrange(8):
      tlist = form(celllist, num)
      collstatus = trygliders(tlist, dist, num)
      event = g.getevent()
      if collstatus[0] == 0 or event.startswith("key"):
         if collstatus[0] == 0:
            g.show("Found clean glider destruction.")
         else:
            g.show("Found result with %d-cell bounding box." % collstatus[0])
         g.new('')
         g.putcells(form(celllist, collstatus[1]))
         g.putcells(glider[collstatus[2]], collstatus[3][0], collstatus[3][1])
         g.exit()
   dist += 1
Thank you! It actually works for every rule with gliders!! Very interesting... it's a shame that only one initial configuration is available, which might have trouble with period-dependent destructions (I had one in a possible pentadecathlon-containing pattern). Very interesting.

And I have to add that it is incredibly fast in tDryLife, much more so than in Life, for some reason.
SoL : FreeElectronics : DeadlyEnemies : 6a-ite : Rule X3VI
what is “sesame oil”?

GUYTU6J
Posts: 2200
Joined: August 5th, 2016, 10:27 am
Location: 拆哪!I repeat, CHINA! (a.k.a. 种花家)
Contact:

Re: Minigame sort of thing

Post by GUYTU6J » September 3rd, 2016, 11:47 am

Oh I remembered where I got this script...
It's posted by @gameoflifeboy here

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

Re: Minigame sort of thing

Post by dvgrn » September 3rd, 2016, 1:09 pm

Rhombic wrote:And I have to add that it is incredibly fast in tDryLife, much more so than in Life, for some reason.
I was able to speed the script up by an order of magnitude or so for Life, with a few small hacks. I don't _think_ that I reduced the script's ability to find things, but I haven't checked very carefully yet.

The original script doesn't seem to check the period of the input pattern, so as far as I could tell it tries hitting, say, your 43x45 still life with each of four phases of glider at each location. Which is obviously a waste of time for a P1 pattern.

Then it seems to try all eight orientations of the input pattern, which might end up hitting the still life from the same glider lane as before, half the time -- I haven't thought through the math to make sure. And it runs a thousand ticks one at a time and checks each generation, where in either HashLife or QuickLife it's probably faster to run a large number of generations and only check at the end.

The 43x45 still life turns out to be script-proof without further modifications, because all the possible implosions that can be triggered by a single glider end up having a bigger bounding box than the original pattern. The still life can catch gliders in various ways to keep its small bounding box, of which maybe the most interesting was this conversion:

Code: Select all

x = 82, y = 45, rule = B3/S23
12b2o10b2o$b2o8bobo9bo2bo$bobo6bobo6b2obob2o$4bo3b3o7bobobobo6bo$2b2o
3bo3bo6bo2bo2bo5bobo$bo6bobobo3b3o3b2o3bo2bobo2bo$b3o3b2obobo2bo11b3ob
ob3o$4bo2bo2bobobobo14bo$3bobobob2obo2bobo3b2ob2o3b2ob2o3b2o$2bobo2bo
2bobo4bo2bobobo3bo2bo2bobobo$2bo4b2o2bo5b4obo2bo2b2obob2obobob2o$b2o
20b3o5bo4bo2bo2bo$17b2o9b2obob2ob2obob2o$b2o7b2ob2o2bo5b2obo2bobob2obo
2bobo$obo6bobobo5bo2bobob2o2bo5bobo2bo$o2b2o4bobo2b6o2bobobo9b2o3b2o$b
2o2bo4b2o11bo3bo4bo35b2o$3b2o11b4o4b4o3bobo2b4o29bo$3bo4b4o3bo3bo10bo
2bo2bo2bo28bo$5bo2bo3bo3bo5b3ob2o2bobob2o32b2o$4b2o3b2obo2b2o4bo2bobo
4b2obo36bo$10bob2o3b2obobo2bo2bo5bo33b4o$2b4o4bo6bob2ob2obob2o2b2ob2o
31bo$2bo2bo5b3o9bobo6bo4bo30b2o$6b2o5bo4b5o3b3o3bob4o32bo$7bo9bo2bo7bo
4bo34b3o8b3o$7bob2o6b2o9bobo3b2o31bo11bo$6b2obo9b4o3b2obobo4bo30b2o11b
o$10bo6b2o2bobobobo2bo3b3o8b3o$11bo4bobo4bobo2b2o3bo11bo$5bo2b4o4b2o5b
obo7b2o11bo$5b4o13b2ob5o5bo$10b2o4b4o9bo3b2obo$5b2o4bo4bo2bo2b5o5bo3bo
$5bobo3bob2obo2bobo4bo4bob3o$7bo2b2ob2ob4ob2o2bo5bobo$6b2obo14bob3o3bo
$7bo2b2ob2ob2ob5obo2bo$5bobo3bob2ob2obo3bo3bo$5b2o4bo8b2o2bo3b3o$10b2o
10b2o6bo$20b2o$20bo2b3o$22b2o2bo$25b2o!
I tried switching the criterion to minimum population, but haven't turned up any really interesting results yet.

For the record, a quick manual search with the Seeds of Destruction Game says that the upper bound for destroying that 43x45 still life is eight gliders. But I suspect the actual minimum cost for complete destruction is just three gliders, so eight doesn't seem very good...!

User avatar
gameoflifeboy
Posts: 474
Joined: January 15th, 2015, 2:08 am

Re: Minigame sort of thing

Post by gameoflifeboy » October 6th, 2016, 10:48 pm

I just updated the glider destruction script. Version 2 detects if the pattern is an oscillator and terminates the script automatically. It also allows the current best results in population and bounding box to be copied to the clipboard without ending the program.

Code: Select all

# glider_destruction_v2.py
# Enter a pattern and this script will try to find a single-glider destruction of it.
#
# Recently added features:
# -When user presses a key, copy result to clipboard instead of ending program to show it
# -Terminates script when periodicity is detected
#
# Ways to improve this script:
# -Use the bounding diamond instead of the bounding box
# -If pattern is symmetrical, not check redundant collisions
# -Change boxstatus and popstatus into a list containing a list or tuple and a tuple, and a list containing a number and a tuple respectively.
# -Find minimum population for 1000 generations instead of population after 1000 generations

import golly as g
from operator import mul

glider = [[-1, -2, 0, -1, -2, 0, -1, 0, 0, 0], [-2, -2, -1, -1, 0, -1, -2, 0, -1, 0], [-1, -2, -3, -1, -1, -1, -2, 0, -1, 0], [-3, -2, -1, -2, -2, -1, -1, -1, -2, 0]]
boxstatus = ([10 ** 9, 10 ** 9], 0, 0, [0, 0]) #(dummy values) box_size, pattern_pos, glider_phase, [glider_x, glider_y]
popstatus = (int(g.getpop()) + 5, 0, 0, [0, 0])

# In this and the following function, "num" represents one of the eight possible transformations of the pattern, encoded as a 3-bit binary number.
# The first bit represents whether the pattern has been turned upside down from its original orientation,
# the second bit represents whether it has been rotated clockwise by 90 degrees,
# and the third bit represents whether it has been flipped about the x-axis.
def form(celllist, num):
	if num not in xrange(8):
		return celllist
	if num >= 4:
		celllist = g.transform(celllist, 0, 0, -1, 0, 0, -1)
		num -= 4
	if num >= 2:
		celllist = g.transform(celllist, 0, 0, 0, 1, -1, 0)
		num -= 2
	if num >= 1:
		celllist = g.transform(celllist, 0, 0, -1, 0, 0, 1)
	return celllist

def deform(celllist, num):
	if num not in xrange(8):
		return celllist
	if num % 2 == 1:
		celllist = g.transform(celllist, 0, 0, -1, 0, 0, 1)
	num = num / 2
	if num % 2 == 1:
		celllist = g.transform(celllist, 0, 0, 0, -1, 1, 0)
	num = num / 2
	if num % 2 == 1:
		celllist = g.transform(celllist, 0, 0, -1, 0, 0, -1)
		num -= 4
	return celllist

def boxform(rect, num):
	newrect = list(rect) #kludge
	if num not in xrange(8):
		return newrect
	if num >= 4:
		newrect[0] = -newrect[0] - newrect[2] + 1
		newrect[1] = -newrect[1] - newrect[3] + 1
		num -= 4
	if num >= 2:
		newrect = [newrect[1], -newrect[0] - newrect[2] + 1, newrect[3], newrect[2]]
		num -= 2
	if num >= 1:
		newrect[0] = -newrect[0] - newrect[2] + 1
	return newrect

def putcells_and_fit(celllist):
	g.putcells(celllist)
	g.fit()

def trygliders(ginfo):
	gdistance = ginfo / 4
	phase = ginfo % 4
	bstatus = boxstatus
	pstatus = popstatus
	for num in xrange(8):
		tlist = form(celllist, num)
		rect = boxform(fullrect, num)
		g.new('')
		g.putcells(tlist)
		gx = rect[0] - 3 - gdistance
		gy = rect[1] - 3 - gdistance
		for w in xrange(rect[2] + 5):
			g.new('')
			g.putcells(tlist)
			g.putcells(glider[phase], gx + w, gy)
			g.fit()
			g.update()
			for gen in xrange(1000):
				g.run(1)
				if int(g.getpop()) <= 2:
					g.new('')
					g.show("Found clean glider destruction.")
					status = 0, num, phase, [gx + w, gy]
					putcells_and_fit(result(celllist, status))
					g.exit()
			box = g.getrect()[2:]
			# Checking the bounding box size and population against the current lowest found.
			if reduce(mul, box) < reduce(mul, bstatus[0]):
				bstatus = (box, num, phase, [gx + w, gy])
			pop = int(g.getpop())
			if pop < pstatus[0]:
				pstatus = (pop, num, phase, [gx + w, gy])
			# Show results if the user presses certain keys
			event = g.getevent()
			if event.startswith("key x"):
				g.new('')
				put_result_pair(celllist, bstatus, pstatus)
				g.select(g.getrect())
				g.copy()
				g.select([])
				g.note("Minimum bounding box and population collisions copied to clipboard.")
			if event.startswith("key q"):
				g.new('')
				g.show("Search stopped.")
				put_result_pair(celllist, bstatus, pstatus)
				g.fit()
				g.exit()
			g.show("Searching for a 1-glider destruction... press <x> to copy minimum bounding box and population results to clipboard; press <q> to quit. Stats: minimum bounding box %dx%d, minimum population %d" % (bstatus[0][0], bstatus[0][1], pstatus[0]))
	return bstatus, pstatus

def result(celllist, status):
	return celllist + deform(g.transform(glider[status[2]], status[3][0], status[3][1]), status[1])

def put_result_pair(celllist, bstatus, pstatus):
	g.putcells(result(celllist, bstatus) + g.transform(result(celllist, pstatus), 3*pattrect[2], 0))

def bounding_box_union(bbox1, bbox2):
	bbox_union = []
	if bbox2[0] > bbox1[0]:
		bbox_union.append(bbox1[0])
	else:
		bbox_union.append(bbox2[0])
	if bbox2[1] > bbox1[1]:
		bbox_union.append(bbox1[1])
	else:
		bbox_union.append(bbox2[1])
	if bbox2[0] + bbox2[2] > bbox1[0] + bbox1[2]:
		bbox_union.append(bbox2[0] + bbox2[2] - bbox_union[0])
	else:
		bbox_union.append(bbox1[0] + bbox1[2] - bbox_union[0])
	if bbox2[1] + bbox2[3] > bbox1[1] + bbox1[3]:
		bbox_union.append(bbox2[1] + bbox2[3] - bbox_union[1])
	else:
		bbox_union.append(bbox1[1] + bbox1[3] - bbox_union[1])
	return bbox_union

glidersexist = (g.evolve([-1, -2, 0, -1, -2, 0, -1, 0, 0, 0], 4) == [0, -1, 1, 0, -1, 1, 0, 1, 1, 1])
if not glidersexist:
	g.exit("Please choose a rule where gliders exist.")

# pattrect is the bounding box of the initial generation
# fullrect is the union of the bounding boxes of all the generations up to the current (specified by the variable "info" for complicated reasons)
pattrect = g.getrect()
fullrect = pattrect
celllist = g.getcells(pattrect)
currlist = celllist
gen_status_list = []
info = 0

g.addlayer()
while True:
	for tup in gen_status_list:
		if tup[0] == currlist:
			if tup[1] == fullrect:
				g.new('')
				g.show("Search complete. No glider destruction found. Minimum bounding box and population results given.")
				put_result_pair(celllist, boxstatus, popstatus)
				g.fit()
				g.exit()
	
	boxstatus, popstatus = trygliders(info)
	info += 1
	
	gen_status_list.append((currlist, fullrect))
	
	g.new('')
	currlist = g.evolve(currlist, 1)
	g.putcells(currlist)
	fullrect = bounding_box_union(fullrect, g.getrect())
EDIT: Fixed a minor bug relating to initial positioning of the glider.

EDIT by dvgrn: Python3 version for Golly 4.0+:
EDIT2: -- but I think it doesn't work yet, since it is finding results but then not displaying them correctly...
EDIT3: the problem seems to be that putcells_and_fit() isn't reconstituting the pattern correctly --
but g.reset() can substitute for it reasonably well, though without the orientation-keeping functionality.
So I've temporarily added g.reset() and commented out the putcells_and_fit() call.

Code: Select all

# glider_destruction_v2_Python3.py
# Enter a pattern and this script will try to find a single-glider destruction of it.
#
# Recently added features:
# -When user presses a key, copy result to clipboard instead of ending program to show it
# -Terminates script when periodicity is detected
#
# Ways to improve this script:
# -Use the bounding diamond instead of the bounding box
# -If pattern is symmetrical, not check redundant collisions
# -Change boxstatus and popstatus into a list containing a list or tuple and a tuple, and a list containing a number and a tuple respectively.
# -Find minimum population for 1000 generations instead of population after 1000 generations

import golly as g
import functools
from operator import mul

glider = [[-1, -2, 0, -1, -2, 0, -1, 0, 0, 0], [-2, -2, -1, -1, 0, -1, -2, 0, -1, 0], [-1, -2, -3, -1, -1, -1, -2, 0, -1, 0], [-3, -2, -1, -2, -2, -1, -1, -1, -2, 0]]
boxstatus = ([10 ** 9, 10 ** 9], 0, 0, [0, 0]) #(dummy values) box_size, pattern_pos, glider_phase, [glider_x, glider_y]
popstatus = (int(g.getpop()) + 5, 0, 0, [0, 0])

# In this and the following function, "num" represents one of the eight possible transformations of the pattern, encoded as a 3-bit binary number.
# The first bit represents whether the pattern has been turned upside down from its original orientation,
# the second bit represents whether it has been rotated clockwise by 90 degrees,
# and the third bit represents whether it has been flipped about the x-axis.
def form(celllist, num):
	if num not in range(8):
		return celllist
	if num >= 4:
		celllist = g.transform(celllist, 0, 0, -1, 0, 0, -1)
		num -= 4
	if num >= 2:
		celllist = g.transform(celllist, 0, 0, 0, 1, -1, 0)
		num -= 2
	if num >= 1:
		celllist = g.transform(celllist, 0, 0, -1, 0, 0, 1)
	return celllist

def deform(celllist, num):
	if num not in range(8):
		return celllist
	if num % 2 == 1:
		celllist = g.transform(celllist, 0, 0, -1, 0, 0, 1)
	num = num / 2
	if num % 2 == 1:
		celllist = g.transform(celllist, 0, 0, 0, -1, 1, 0)
	num = num / 2
	if num % 2 == 1:
		celllist = g.transform(celllist, 0, 0, -1, 0, 0, -1)
		num -= 4
	return celllist

def boxform(rect, num):
	newrect = list(rect) #kludge
	if num not in range(8):
		return newrect
	if num >= 4:
		newrect[0] = -newrect[0] - newrect[2] + 1
		newrect[1] = -newrect[1] - newrect[3] + 1
		num -= 4
	if num >= 2:
		newrect = [newrect[1], -newrect[0] - newrect[2] + 1, newrect[3], newrect[2]]
		num -= 2
	if num >= 1:
		newrect[0] = -newrect[0] - newrect[2] + 1
	return newrect

def putcells_and_fit(celllist):
	g.putcells(celllist)
	g.fit()

def trygliders(ginfo):
	gdistance = ginfo // 4
	phase = ginfo % 4
	bstatus = boxstatus
	pstatus = popstatus
	for num in range(8):
		tlist = form(celllist, num)
		rect = boxform(fullrect, num)
		g.new('')
		g.putcells(tlist)
		gx = rect[0] - 3 - gdistance
		gy = rect[1] - 3 - gdistance
		for w in range(rect[2] + 5):
			g.new('')
			g.putcells(tlist)
			g.putcells(glider[phase], gx + w, gy)
			g.fit()
			g.update()
			for gen in range(1000):
				g.run(1)
				if int(g.getpop()) <= 2:
					g.reset()
					g.show("Found clean glider destruction.")
					# g.new('')
					# status = 0, num, phase, [gx + w, gy]
					# putcells_and_fit(result(celllist, status))
					g.exit()
			box = g.getrect()[2:]
			# Checking the bounding box size and population against the current lowest found.
			if functools.reduce(mul, box) < functools.reduce(mul, bstatus[0]):
				bstatus = (box, num, phase, [gx + w, gy])
			pop = int(g.getpop())
			if pop < pstatus[0]:
				pstatus = (pop, num, phase, [gx + w, gy])
			# Show results if the user presses certain keys
			event = g.getevent()
			if event.startswith("key x"):
				g.new('')
				put_result_pair(celllist, bstatus, pstatus)
				g.select(g.getrect())
				g.copy()
				g.select([])
				g.note("Minimum bounding box and population collisions copied to clipboard.")
			if event.startswith("key q"):
				g.new('')
				g.show("Search stopped.")
				put_result_pair(celllist, bstatus, pstatus)
				g.fit()
				g.exit()
			g.show("Searching for a 1-glider destruction... press <x> to copy minimum bounding box and population results to clipboard; press <q> to quit. Stats: minimum bounding box %dx%d, minimum population %d" % (bstatus[0][0], bstatus[0][1], pstatus[0]))
	return bstatus, pstatus

def result(celllist, status):
	return celllist + deform(g.transform(glider[status[2]], status[3][0], status[3][1]), status[1])

def put_result_pair(celllist, bstatus, pstatus):
	g.putcells(result(celllist, bstatus) + g.transform(result(celllist, pstatus), 3*pattrect[2], 0))

def bounding_box_union(bbox1, bbox2):
	bbox_union = []
	if bbox2[0] > bbox1[0]:
		bbox_union.append(bbox1[0])
	else:
		bbox_union.append(bbox2[0])
	if bbox2[1] > bbox1[1]:
		bbox_union.append(bbox1[1])
	else:
		bbox_union.append(bbox2[1])
	if bbox2[0] + bbox2[2] > bbox1[0] + bbox1[2]:
		bbox_union.append(bbox2[0] + bbox2[2] - bbox_union[0])
	else:
		bbox_union.append(bbox1[0] + bbox1[2] - bbox_union[0])
	if bbox2[1] + bbox2[3] > bbox1[1] + bbox1[3]:
		bbox_union.append(bbox2[1] + bbox2[3] - bbox_union[1])
	else:
		bbox_union.append(bbox1[1] + bbox1[3] - bbox_union[1])
	return bbox_union

glidersexist = (g.evolve([-1, -2, 0, -1, -2, 0, -1, 0, 0, 0], 4) == [0, -1, 1, 0, -1, 1, 0, 1, 1, 1])
if not glidersexist:
	g.exit("Please choose a rule where gliders exist.")

# pattrect is the bounding box of the initial generation
# fullrect is the union of the bounding boxes of all the generations up to the current (specified by the variable "info" for complicated reasons)
pattrect = g.getrect()
fullrect = pattrect
celllist = g.getcells(pattrect)
currlist = celllist
gen_status_list = []
info = 0

g.addlayer()
while True:
	for tup in gen_status_list:
		if tup[0] == currlist:
			if tup[1] == fullrect:
				g.new('')
				g.show("Search complete. No glider destruction found. Minimum bounding box and population results given.")
				put_result_pair(celllist, boxstatus, popstatus)
				g.fit()
				g.exit()
	
	boxstatus, popstatus = trygliders(info)
	info += 1
	
	gen_status_list.append((currlist, fullrect))
	
	g.new('')
	currlist = g.evolve(currlist, 1)
	g.putcells(currlist)
	fullrect = bounding_box_union(fullrect, g.getrect())

GUYTU6J
Posts: 2200
Joined: August 5th, 2016, 10:27 am
Location: 拆哪!I repeat, CHINA! (a.k.a. 种花家)
Contact:

Re: Minigame sort of thing

Post by GUYTU6J » January 14th, 2017, 12:13 pm

Just a sudden thought:could I change the glider into any other spaceship(of course not something like gemini) when using this destruction script? :wink:

User avatar
gameoflifeboy
Posts: 474
Joined: January 15th, 2015, 2:08 am

Re: Minigame sort of thing

Post by gameoflifeboy » January 15th, 2017, 12:28 am

It's possible, but it takes a bit of work.

The script would be easiest to modify for collisions with other glide-symmetric diagonal spaceships, because then pattern (or the spaceship) could be transformed in the same 8 ways to non-redundantly cover all possible collisions. In my script I transform the pattern while keeping the glider in the same orientation, and return the pattern to its initial configuration for the result.

The variable "glider" is a list of cell lists representing the 4 phases of a glider. To search collisions with, say, a seal, you would need to replace it with a list of cell lists for the 6 phases of the seal.

Code: Select all

glider = [[-22, -35, -22, -34, -21, -34, -22, -33, -21, -33, -24, -31, -23, -31, -22, -31, -24, -30, -23, -30, -22, -30, -20, -28, -21, -27, -19, -27, -26, -26, -23, -26, -26, -25, -24, -25, -22, -25, -20, -25, -18, -25, -17, -25, -16, -25, -34, -24, -33, -24, -32, -24, -29, -24, -24, -24, -18, -24, -17, -24, -30, -23, -27, -23, -26, -23, -24, -23, -21, -23, -19, -23, -18, -23, -34, -22, -33, -22, -31, -22, -30, -22, -27, -22, -26, -22, -24, -22, -23, -22, -19, -22, -18, -22, -17, -22, -16, -22, -15, -22, -32, -21, -25, -21, -24, -21, -23, -21, -19, -21, -14, -21, -18, -20, -14, -20, -23, -19, -22, -19, -14, -19, -26, -18, -25, -18, -24, -18, -23, -18, -22, -18, -21, -18, -17, -18, -15, -18, -10, -18, -9, -18, -25, -17, -20, -17, -18, -17, -23, -16, -22, -16, -21, -16, -18, -16, -17, -16, -15, -16, -14, -16, -12, -16, -11, -16, -9, -16, -8, -16, -22, -15, -21, -15, -19, -15, -13, -15, -12, -15, -11, -15, -10, -15, -9, -15, -7, -15, -5, -15, -4, -15, -20, -14, -17, -14, -16, -14, -15, -14, -10, -14, -8, -14, -7, -14, -3, -14, -20, -13, -15, -13, -14, -13, -11, -13, -10, -13, -14, -12, -13, -12, -3, -12, -16, -11, -12, -11, -8, -11, -5, -11, -3, -11, -2, -11, -17, -10, -12, -10, -2, -10, -17, -9, -12, -9, -11, -9, -10, -9, -8, -9, -7, -9, -6, -9, -5, -9, -4, -9, -1, -9, -16, -8, -13, -8, -11, -8, -2, -8, -1, -8, -14, -7, -13, -7, -11, -7, -7, -7, -6, -7, -1, -7, -13, -6, -10, -6, -8, -6, -7, -6, -13, -5, -12, -5, -11, -5, -10, -5, -8, -5, -1, -5, -13, -4, -11, -4, -8, -4, -5, -4, -4, -4, -2, -4, -1, -4, -9, -3, -8, -3, -4, -3, -8, -2, -7, -2, -6, -2, -4, -2, -3, -2, -2, -2, -4, -1, -3, -1], [-23, -34, -22, -34, -21, -34, -20, -33, -23, -31, -21, -31, -24, -30, -23, -30, -25, -27, -24, -27, -21, -27, -20, -27, -19, -27, -17, -27, -20, -26, -19, -26, -17, -26, -30, -25, -26, -25, -25, -25, -24, -25, -22, -25, -20, -25, -18, -25, -17, -25, -16, -25, -34, -24, -32, -24, -29, -24, -26, -24, -24, -24, -23, -24, -22, -24, -21, -24, -35, -23, -33, -23, -31, -23, -30, -23, -27, -23, -26, -23, -21, -23, -20, -23, -19, -23, -33, -22, -32, -22, -31, -22, -26, -22, -24, -22, -19, -22, -18, -22, -24, -21, -23, -21, -17, -21, -16, -21, -15, -21, -14, -21, -18, -20, -17, -20, -15, -20, -14, -20, -27, -19, -17, -19, -26, -18, -24, -18, -23, -18, -22, -18, -21, -18, -17, -18, -16, -18, -15, -18, -10, -18, -9, -18, -25, -17, -22, -17, -20, -17, -15, -17, -10, -17, -9, -17, -23, -16, -22, -16, -19, -16, -17, -16, -16, -16, -15, -16, -13, -16, -9, -16, -8, -16, -17, -15, -16, -15, -12, -15, -11, -15, -7, -15, -5, -15, -4, -15, -21, -14, -20, -14, -19, -14, -16, -14, -15, -14, -14, -14, -10, -14, -7, -14, -5, -14, -4, -14, -10, -13, -7, -13, -6, -13, -5, -13, -4, -13, -13, -12, -10, -12, -8, -12, -7, -12, -5, -12, -14, -11, -13, -11, -8, -11, -7, -11, -6, -11, -5, -11, -4, -11, -3, -11, -17, -10, -16, -10, -15, -10, -14, -10, -13, -10, -10, -10, -3, -10, -2, -10, -17, -9, -16, -9, -14, -9, -13, -9, -10, -9, -8, -9, -7, -9, -6, -9, -5, -9, -4, -9, -13, -8, -10, -8, -9, -8, -4, -8, -2, -8, -1, -8, -15, -7, -14, -7, -10, -7, -9, -7, -7, -7, -6, -7, -5, -7, -4, -7, -3, -7, -1, -7, -13, -6, -10, -6, -8, -6, -5, -6, -4, -6, -3, -6, -2, -6, -13, -5, -12, -5, -11, -5, -5, -5, -4, -5, -3, -5, -9, -4, -8, -4, -4, -4, -2, -4, -1, -4, -12, -3, -7, -3, -2, -3, -10, -2, -5, -2, -3, -2, -2, -2, -8, -1, -7, -1, -4, -1], [-25, -34, -24, -34, -22, -34, -21, -34, -22, -33, -21, -33, -22, -32, -21, -32, -23, -31, -22, -31, -23, -30, -23, -29, -24, -28, -23, -28, -22, -28, -24, -27, -23, -27, -21, -27, -18, -27, -17, -27, -26, -26, -21, -26, -19, -26, -18, -26, -17, -26, -31, -25, -30, -25, -25, -25, -24, -25, -23, -25, -34, -24, -29, -24, -26, -24, -21, -24, -16, -24, -15, -24, -35, -23, -33, -23, -31, -23, -30, -23, -26, -23, -22, -23, -20, -23, -35, -22, -33, -22, -32, -22, -26, -22, -24, -22, -19, -22, -18, -22, -28, -21, -27, -21, -26, -21, -24, -21, -23, -21, -17, -21, -14, -21, -26, -20, -25, -20, -21, -20, -17, -20, -15, -20, -14, -20, -26, -19, -25, -19, -17, -19, -16, -19, -26, -18, -22, -18, -16, -18, -10, -18, -9, -18, -25, -17, -24, -17, -22, -17, -21, -17, -14, -17, -10, -17, -9, -17, -22, -16, -20, -16, -19, -16, -17, -16, -14, -16, -21, -15, -20, -15, -19, -15, -17, -15, -16, -15, -12, -15, -8, -15, -7, -15, -5, -15, -20, -14, -15, -14, -14, -14, -13, -14, -12, -14, -10, -14, -9, -14, -8, -14, -7, -14, -5, -14, -4, -14, -12, -13, -11, -13, -10, -13, -17, -12, -13, -12, -12, -12, -7, -12, -4, -12, -13, -11, -9, -11, -7, -11, -6, -11, -5, -11, -16, -10, -13, -10, -10, -10, -3, -10, -2, -10, -17, -9, -16, -9, -14, -9, -10, -9, -8, -9, -7, -9, -6, -9, -5, -9, -4, -9, -2, -9, -15, -8, -14, -8, -9, -8, -7, -8, -4, -8, -2, -8, -1, -8, -15, -7, -14, -7, -9, -7, -7, -7, -6, -7, -3, -7, -9, -6, -4, -6, -1, -6, -15, -5, -14, -5, -12, -5, -11, -5, -4, -5, -1, -5, -12, -4, -11, -4, -9, -4, -4, -4, -12, -3, -11, -3, -10, -3, -8, -3, -7, -3, -5, -3, -4, -3, -2, -3, -1, -3, -10, -2, -9, -2, -8, -2, -7, -2, -5, -2, -4, -2, -3, -2, -8, -1], [-24, -35, -22, -35, -24, -34, -22, -34, -24, -33, -21, -33, -22, -32, -23, -31, -22, -31, -24, -30, -23, -28, -22, -28, -26, -27, -25, -27, -23, -27, -22, -27, -18, -27, -21, -26, -18, -26, -17, -26, -31, -25, -30, -25, -25, -25, -24, -25, -23, -25, -22, -25, -21, -25, -18, -25, -31, -24, -30, -24, -26, -24, -22, -24, -21, -24, -19, -24, -18, -24, -16, -24, -35, -23, -34, -23, -33, -23, -31, -23, -30, -23, -25, -23, -19, -23, -18, -23, -16, -23, -15, -23, -34, -22, -33, -22, -27, -22, -23, -22, -18, -22, -16, -22, -15, -22, -28, -21, -25, -21, -17, -21, -14, -21, -13, -21, -27, -20, -23, -20, -22, -20, -21, -20, -15, -20, -25, -19, -24, -19, -23, -19, -22, -19, -20, -19, -17, -19, -16, -19, -25, -18, -24, -18, -22, -18, -18, -18, -16, -18, -14, -18, -10, -18, -9, -18, -25, -17, -22, -17, -14, -17, -11, -17, -8, -17, -22, -16, -18, -16, -16, -16, -14, -16, -13, -16, -21, -15, -20, -15, -19, -15, -16, -15, -13, -15, -12, -15, -7, -15, -15, -14, -12, -14, -8, -14, -7, -14, -6, -14, -5, -14, -4, -14, -16, -13, -15, -13, -11, -13, -10, -13, -9, -13, -5, -13, -16, -12, -15, -12, -13, -12, -9, -12, -8, -12, -7, -12, -5, -12, -4, -12, -18, -11, -15, -11, -14, -11, -13, -11, -9, -11, -6, -11, -5, -11, -18, -10, -16, -10, -15, -10, -3, -10, -16, -9, -14, -9, -11, -9, -9, -9, -6, -9, -5, -9, -4, -9, -3, -9, -2, -9, -15, -8, -14, -8, -9, -8, -7, -8, -6, -8, -2, -8, -9, -7, -7, -7, -2, -7, -15, -6, -11, -6, -9, -6, -4, -6, -15, -5, -9, -5, -4, -5, -3, -5, -2, -5, -1, -5, -14, -4, -12, -4, -11, -4, -2, -4, -1, -4, -11, -3, -10, -3, -8, -3, -4, -3, -2, -3, -9, -2, -8, -2, -7, -2, -5, -2, -4, -2], [-23, -36, -24, -35, -23, -34, -22, -34, -24, -33, -22, -33, -23, -32, -22, -32, -25, -31, -23, -31, -24, -30, -23, -28, -19, -28, -25, -27, -24, -27, -23, -27, -22, -27, -18, -27, -27, -26, -25, -26, -17, -26, -30, -25, -27, -25, -25, -25, -24, -25, -22, -25, -21, -25, -18, -25, -34, -24, -31, -24, -30, -24, -24, -24, -21, -24, -18, -24, -16, -24, -34, -23, -25, -23, -24, -23, -18, -23, -17, -23, -16, -23, -34, -22, -31, -22, -27, -22, -24, -22, -23, -22, -18, -22, -14, -22, -33, -21, -27, -21, -26, -21, -25, -21, -23, -21, -17, -21, -14, -21, -27, -20, -26, -20, -23, -20, -22, -20, -16, -20, -14, -20, -25, -19, -22, -19, -20, -19, -27, -18, -26, -18, -25, -18, -21, -18, -20, -18, -19, -18, -18, -18, -16, -18, -15, -18, -10, -18, -9, -18, -25, -17, -21, -17, -18, -17, -16, -17, -15, -17, -14, -17, -10, -17, -9, -17, -21, -16, -20, -16, -18, -16, -17, -16, -16, -16, -14, -16, -10, -16, -7, -16, -21, -15, -20, -15, -14, -15, -11, -15, -10, -15, -9, -15, -7, -15, -16, -14, -12, -14, -11, -14, -10, -14, -9, -14, -8, -14, -6, -14, -5, -14, -15, -13, -5, -13, -3, -13, -15, -12, -5, -12, -18, -11, -17, -11, -14, -11, -13, -11, -12, -11, -10, -11, -9, -11, -8, -11, -7, -11, -6, -11, -2, -11, -18, -10, -17, -10, -16, -10, -8, -10, -7, -10, -4, -10, -16, -9, -12, -9, -11, -9, -9, -9, -6, -9, -4, -9, -1, -9, -15, -8, -14, -8, -13, -8, -12, -8, -11, -8, -9, -8, -7, -8, -3, -8, -1, -8, -13, -7, -11, -7, -9, -7, -7, -7, -15, -6, -14, -6, -13, -6, -12, -6, -11, -6, -9, -6, -7, -6, -6, -6, -5, -6, -2, -6, -15, -5, -14, -5, -13, -5, -11, -5, -9, -5, -8, -5, -7, -5, -6, -5, -5, -5, -4, -5, -1, -5, -11, -4, -10, -4, -7, -4, -6, -4, -5, -4, -2, -4, -10, -3, -8, -3, -6, -3, -4, -3, -3, -3, -2, -3, -8, -2, -7, -2, -4, -2], [-23, -36, -22, -36, -24, -35, -23, -34, -22, -34, -22, -33, -25, -32, -23, -32, -25, -31, -23, -31, -24, -30, -21, -29, -21, -28, -26, -27, -24, -27, -23, -27, -22, -27, -21, -27, -20, -27, -19, -27, -18, -27, -34, -26, -25, -26, -20, -26, -19, -26, -17, -26, -34, -25, -28, -25, -27, -25, -25, -25, -22, -25, -21, -25, -17, -25, -31, -24, -30, -24, -29, -24, -28, -24, -27, -24, -25, -24, -21, -24, -34, -23, -33, -23, -32, -23, -31, -23, -28, -23, -23, -23, -18, -23, -17, -23, -16, -23, -34, -22, -33, -22, -32, -22, -27, -22, -26, -22, -24, -22, -20, -22, -17, -22, -15, -22, -23, -21, -16, -21, -15, -21, -14, -21, -26, -20, -22, -20, -16, -20, -15, -20, -27, -19, -26, -19, -22, -19, -27, -18, -26, -18, -21, -18, -20, -18, -19, -18, -16, -18, -15, -18, -12, -18, -9, -18, -24, -17, -19, -17, -18, -17, -15, -17, -10, -17, -9, -17, -24, -16, -20, -16, -14, -16, -8, -16, -7, -16, -5, -16, -21, -15, -20, -15, -17, -15, -16, -15, -14, -15, -9, -15, -8, -15, -7, -15, -5, -15, -14, -14, -12, -14, -11, -14, -10, -14, -15, -13, -14, -13, -13, -13, -12, -13, -5, -13, -4, -13, -3, -13, -13, -12, -5, -12, -4, -12, -3, -12, -18, -11, -17, -11, -14, -11, -13, -11, -10, -11, -9, -11, -3, -11, -2, -11, -18, -10, -17, -10, -14, -10, -11, -10, -8, -10, -7, -10, -6, -10, -4, -10, -2, -10, -15, -9, -14, -9, -9, -9, -3, -9, -2, -9, -1, -9, -15, -8, -14, -8, -12, -8, -11, -8, -9, -8, -8, -8, -7, -8, -3, -8, -2, -8, -11, -7, -9, -7, -7, -7, -15, -6, -14, -6, -11, -6, -9, -6, -3, -6, -2, -6, -14, -5, -12, -5, -9, -5, -8, -5, -6, -5, -5, -5, -4, -5, -3, -5, -2, -5, -10, -4, -7, -4, -2, -4, -10, -3, -9, -3, -8, -3, -3, -3, -8, -2, -6, -2, -5, -2, -3, -2]
Make sure that in the cell list, the spaceship points down to the right and the coordinate 0,0 is on or to the right of the spaceship's axis of glide-reflective symmetry.
I guess I could implement an RLE-to-cell-list converter so that the spaceship can be read from the clipboard, but I haven't done this yet.

The only other change that needs to take place is to replace

Code: Select all

   gdistance = ginfo / 4
   phase = ginfo % 4
with

Code: Select all

   gdistance = n * ginfo / p
   phase = ginfo % p
where n is the number of cells the spaceship travels in each period, and p is the period; and to replace the 5 in

Code: Select all

      for w in xrange(rect[2] + 5):
with the negative of the largest number n such that the cell at (0,n) stays at least two spaces (or one diagonal space) to the left of the spaceship, when in the form described by the cell list. In the case of the seal, that number is 17.

It might also be necessary, if searching outside of Life, to redefine the variable telling whether gliders exist in the given rule:

Code: Select all

glidersexist = (g.evolve([-1, -2, 0, -1, -2, 0, -1, 0, 0, 0], 4) == [0, -1, 1, 0, -1, 1, 0, 1, 1, 1])
to work for the new spaceship instead, by replacing the two cell lists with two from the spaceship's evolution.

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

Re: Minigame sort of thing

Post by calcyman » January 15th, 2017, 8:30 am

gameoflifeboy wrote:I guess I could implement an RLE-to-cell-list converter so that the spaceship can be read from the clipboard, but I haven't done this yet.
You mean g.parse()?
What do you do with ill crystallographers? Take them to the mono-clinic!

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

Re: Minigame sort of thing

Post by BlinkerSpawn » January 31st, 2017, 12:14 pm

Back on topic, how about this descendant of the pi?

Code: Select all

x = 17, y = 12, rule = Mirrors
7.3A$8.A$6.2A.2A$3.11A$2A4.A.A.A4.2A$A5.A3.A5.A$A15.A$.2A.3A3.3A.2A$
4.A2.A.A2.A$4.2A.A.A.2A$4.2A5.2A$4.3A3.3A!
Possible in 3.
LifeWiki: Like Wikipedia but with more spaceships. [citation needed]

Image

Post Reply