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

Thread For Synthesisable Spaceship Guns

For discussion of specific patterns or specific families of patterns, both newly-discovered and well-known.

Re: Thread For Synthesisable Spaceship Guns

Postby dvgrn » March 10th, 2018, 10:58 am

Looks like I didn't make the actual recipe for a 2-engine Cordership seed available anywhere. Here it is:

E7 E11 E11 O21 E7 E33 O-11 O-11 O-11 E-29 O-41 E-7 E-5 E-11 E-19 E3 E19 E-73 E-51 E-33 E-41 E-25 E-27 O-29 E-43 E-27 E-21 O-21 O-15 O-39 O-35 O-11 O7 O-27 O-3 E-11 E-25 E-73 E-53 E-63 E-57 E-47 E-77 E-73 O-107 O-101 O-85 E-103 O-125 O-125 O-97 O-91 O-97 O-81 O-83 O-99 E-55 O-73 O-71 E-73 O-69 E-85 O-83 E-75 E-75 E-121 E-107 E-141 E-139 O-165 O-137 E-147 E-157 E-139 E-145 E-131 E-129 E-113 E-93 E-109 E-125 E-55 O-33 O-41 E-61 O-39 E-51 E-31 E17 E9 E9 E21 O1 O-13 O-33 O-19 E-15 E-17 O-21 E25 E39 E33 O5 E29 O15 O21 O11 O21 O3 O27 O33 O45

10, 7, 1, 15, -4, 33, 11, 20, -9, 6, 45, 4, 13, 13, 3, 23, -39, 43, -3, 13, 7, 13, 11, 7, 2, 15, 3, 10, 10, 4, -8, 6, 9, -2, 6, 11, -99, 6, 75, 8, 11, 13, 16, 37, 10, 7, 6, 33, 7, -5, -13, 22, 7, 13, 17, -18, 11, 11, 22, 2, 5, 12, 7, 4, -50, 8, 9, 16, 54, 35, -15, 24, -3, 13, 2, 11, 3, 14, 21, 7, -99, -6, 13, 15, -4, 12, 1, -99, 13, 11, -1, 27, 48, 14, 1, 5, 6, 4, -72, -20, 21, 65, 8, 6, 10, 8, 3, 4, 9, 2, 14, -99

The list of integers is the minimum following distance for each glider specified in the EO-recipe. Lane numbers are measured in quarter-diagonals as per Tradition. The first six gliders just push the target back by nine full diagonals -- that was just because the Cordership shotgun loop in the last post needed a little more space. In other situations those six initial gliders can be removed.

Here's what the over-optimized construction looks like:

Code: Select all
x = 761, y = 777, rule = B3/S23
2o$2o4$3o$o$bo9$11b3o$11bo$12bo8$13b2o$12b2o$14bo5$13b3o$13bo$14bo$31b
3o$31bo$32bo39$75b2o$74b2o$76bo2$80b2o$79b2o$81bo11$59b2o29b2o$58b2o
29b2o$60bo30bo11$99b2o$98b2o$100bo$113b2o$112b2o$114bo21$144b2o$119b2o
22b2o$118b2o25bo$120bo$113b2o$112b2o$114bo8$128b2o$127b2o$129bo3$117b
2o$116b2o$118bo24b2o$142b2o$144bo2$133b2o$132b2o$134bo7$155b2o$154b2o$
156bo10$165b3o$165bo$166bo4$165b2o$164b2o$166bo8b2o$174b2o$176bo13$
193b2o$192b2o$194bo2$196b3o$196bo$197bo8$209b3o$209bo$210bo4$217b3o$
217bo$218bo2$207b3o$207bo$208bo23b3o$232bo$213b3o17bo$213bo$214bo$203b
2o$202b2o$204bo29b3o$234bo$224b3o8bo$224bo$225bo$236b2o$214b2o19b2o$
213b2o22bo$215bo8$240b2o$230b2o7b2o$229b2o10bo$231bo11$228b2o$227b2o$
229bo14$246b2o$245b2o$247bo36$266b3o$266bo$267bo8$279b3o$279bo$280bo5$
294b3o$294bo$295bo3$291b2o$290b2o$292bo21$319b3o$319bo$320bo9$313b3o$
313bo$314bo14b3o$329bo$330bo3$320b3o$320bo$321bo2$338b3o$338bo$339bo5$
353b3o$353bo$354bo9$378b2o$377b2o$365b3o11bo$365bo$366bo8$380b3o$380bo
$381bo5$374b3o$374bo$375bo2$392b3o$369b2o21bo$368b2o23bo$370bo6$384b2o
$383b2o$385bo7$376b2o$375b2o$377bo$413b2o$412b2o$414bo$417b3o$417bo$
418bo2$414b2o$413b2o$415bo3$470b2o$393b2o74b2o$392b2o77bo$394bo5$427b
3o$427bo$428bo3$479b2o$438b2o38b2o$437b2o41bo$439bo2$442b2o$441b2o$
443bo3$495b2o$490b2o2b2o$489b2o5bo$491bo10$517b2o$516b2o$518bo13$512b
3o$512bo$513bo3$434b3o93b2o$434bo94b2o4b2o$435bo95bo2b2o$536bo4$507b3o
$507bo$508bo3$502b2o$501b2o$503bo5$463b2o$462b2o52b3o$464bo51bo$517bo
9$528b3o$528bo$529bo$521b2o$483b3o34b2o$483bo38bo$484bo3$488b2o$487b2o
$489bo44b2o$482b2o49b2o10b2o6b3o$481b2o52bo8b2o7bo$483bo62bo7bo8$498b
2o$497b2o$499bo7b2o$506b2o$508bo48b3o$557bo7b3o$558bo6bo$566bo2$572b2o
$571b2o$573bo2$519b2o$518b2o66b3o$520bo56b2o7bo$530b2o44b2o9bo$529b2o
47bo$531bo2$579b3o$579bo26b2o$580bo24b2o$607bo5$605b3o$605bo$554b2o50b
o$553b2o$555bo6$618b3o$618bo$619bo6$621b3o$621bo$622bo$629b3o$629bo$
567b2o61bo$566b2o$568bo55b3o$624bo$625bo3$566b2o$565b2o$567bo2$645b3o$
645bo$646bo3b3o$650bo$651bo12$670b3o$670bo$671bo125$758b2o$758bobo$
758bo!
#C [[ THUMBNAIL THUMBSIZE 2 AUTOSTART STEP 5 PAUSE 2 LINEAR ZOOM HEIGHT 600 ]]
#C [[ T 100 X -360 Y -350 ZOOM 4 ]]
#C [[ T 3200 X -360 Y -350 ZOOM 6 ]]
#C [[ T 4000 X -435 Y -425 ZOOM 7 ]]
#C [[ STOP 4200 ]]

And here's the script I'm currently using to minimize slow-salvo recipes so that they're not too boring to watch:

import golly as g

def getbackground(clist):
   g.setrule("B12345678/S")
   background = g.evolve(clist, 1)
   g.setrule("B3/S23")
   return background

class Glider:
  def __init__(self, rlestr, timeoffset, laneoffset):
    self.dt = timeoffset
    self.dx = laneoffset
    cells = g.parse(rlestr)
    self.clist = g.transform(cells,-cells[0],0)
    self.background = getbackground(self.clist)

def matches(glider, x, y):
  for i in range(0, len(glider.clist), 2):
    if g.getcell(glider.clist[i]+x, glider.clist[i+1]+y) == 0: return 0
  bkg = glider.background
  for i in range(0, len(bkg), 2):
    if g.getcell(bkg[i]+x, bkg[i+1]+y) == 1:  return 0
  return 1

def makerecipe(background, gliderlist):
  g.new("Recipe")
  g.putcells(background)
  offset = max(background[1::2])+4
  for glider, delta in gliderlist:
    clist, lane = glider
    g.putcells(clist, (lane+1)/2+offset, offset)
    offset += delta

g.setalgo("HashLife")

glist = [ Glider("3o$o$bo!",0,0), Glider("bo$2o$obo!",1,-2), \
          Glider("2o$obo$o!",2,-1), Glider("b2o$2o$2bo!",3,-1) ]
gliderE, gliderO = g.transform(glist[0].clist,-glist[0].dx,0), g.transform(glist[1].clist,-glist[1].dx,0)   # glist[0].clist, glist[1].clist

if g.numstates()>2: g.exit("Please use a two-state rule.")

r=g.getrect()
if len(r)==0: g.exit("No pattern found.")

nongliderpat, ngp3, recipelist, recipe, remainder, count = [], [], [], "", g.getcells(r), 0
all = remainder

while len(remainder):
  matchflag = 0
  for index in range(len(glist)):
    glider = glist[index]
    if g.getkey() == "q": g.exit()
    TLx, TLy = remainder[0],remainder[1]
    matchflag = matches(glider, TLx, TLy)
    if matchflag:
      # remove the matched pattern from the universe
      count+=1
      g.putcells(glider.clist, TLx, TLy, 1, 0, 0, 1, "xor")
      g.update()
      g.show("Found glider #" + str(glider.dt) + " at " + str([TLx,TLy]))
      if recipe!="": recipe+=" "
      recipe+="E" if  glider.dt%2==0 else "O"
      lane = (TLx-TLy+glider.dx)*2-1
      recipe+=str(lane)
      recipelist+=[[(gliderE if glider.dt%2==0 else gliderO),lane]]
      nomatch = 0
      break
  if matchflag==0:
    nongliderpat+=[TLx, TLy]
    ngp3 +=[TLx, TLy, 3]
    g.setcell(TLx, TLy, 0)
  remainder = g.getcells(g.getrect())

if len(ngp3)%2 == 0: ngp3+=[0] # mark as three-state pattern

LONG_ENOUGH = 1024*(len(recipelist)+1) # extra time for the unknown non-glider pattern

g.show("Running pattern...")
g.putcells(all)
g.run(LONG_ENOUGH)
output = g.getrect()
if len(output)==0: g.exit("This script wasn't designed to build a big pile of nothing.  Need a hashable output.")
hash = g.hash(output)
g.show("Restoring pattern...")
g.select(output)
g.clear(0)
g.putcells(all)

# g.note(str([len(recipelist),recipelist]))
g.addlayer()

# first find the shortest fixed-width separation between gliders
minsep, sep=3, 256

while 1:
  midpoint = int(minsep + (sep-minsep)/2)
  offset=max(nongliderpat[1::2])+4
  g.show("Regenerating pattern at midpoint = " +str(midpoint) + ", minsep = " + str(minsep) + ", sep = "+ str(sep))
  g.new("Results")
  g.putcells(nongliderpat)
  for clist, lane in recipelist:
    g.putcells(clist, (lane+1)/2+offset, offset)
    offset += midpoint
  g.run(LONG_ENOUGH)
  g.fit()
  g.update()
  output = g.getrect()
  if len(output)==0: g.exit("Weird magic vanish reaction happened.  Need a hashable output.")
  newhash = g.hash(output)
  if newhash == hash:
    sep = midpoint
  else:
     if minsep == midpoint: break  # binary search has found a minimum
    minsep = midpoint
if sep != minsep+1: g.exit("Assertion failed -- sep vs. minsep," + str([sep, minsep]))

# g.note(str(len(recipelist))+" gliders to place.")

deltalist = [sep]*len(recipelist)
makerecipe(nongliderpat, zip(recipelist, deltalist))
g.run(LONG_ENOUGH)
output = g.getrect()
if len(output)==0: g.exit("This script wasn't designed to build a big pile of nothing.  Need a hashable output.")
hash = g.hash(output)

LONG_ENOUGH = 2**12
while LONG_ENOUGH<len(deltalist)*4*sep+4000: LONG_ENOUGH*=2

ptr=0
while ptr<len(deltalist):
  mindelta, maxdelta = -100, sep
  newlist = deltalist[:]
  while 1:
    midpoint = int(mindelta + (maxdelta-mindelta)/2)
    newlist[ptr] = midpoint
    g.show(str(newlist).replace(" ",""))
    makerecipe(nongliderpat, zip(recipelist, newlist))
    g.run(LONG_ENOUGH)
    output = g.getrect()
    if len(output)==0: g.exit("Need a hashable output.")
    newhash = g.hash(output)
    if hash == newhash:
      if maxdelta == midpoint: break
      maxdelta = midpoint
    else:
      if mindelta == midpoint: break
      mindelta = midpoint
  deltalist[ptr]=mindelta+1  # take the last good one and continue
  makerecipe(nongliderpat, zip(recipelist, deltalist))
  g.fit()
  g.update()
  ptr+=1

g.setclipstr(recipe+"\n\n"+str(deltalist))
g.show("Done.")

This can take an unoptimized slow salvo, like the one that comes out of the Cordership shotgun --

x = 102522, y = 102498, rule = B3/S23
2o$2o180$187bo$186b2o$186bobo1140$1330b2o$1329b2o$1331bo747$2079b2o$
2078b2o$2080bo922$3008b2o$3008bobo$3008bo961$3965bo$3964b2o$3964bobo
647$4627bo$4626b2o$4626bobo893$5499b2o$5499bobo$5499bo1301$6802b2o$
6802bobo$6802bo1281$8085b2o$8085bobo$8085bo1010$9088b2o$9087b2o$9089bo
1081$10165b2o$10165bobo$10165bo588$10772b2o$10771b2o$10773bo1039$
11815bo$11814b2o$11814bobo312$12125b2o$12124b2o$12126bo659$12782b2o$
12781b2o$12783bo870$13665b2o$13664b2o$13666bo373$14048b2o$14047b2o$
14049bo1065$15070bo$15069b2o$15069bobo652$15734b2o$15733b2o$15735bo
1044$16789b2o$16788b2o$16790bo1137$17925bo$17924b2o$17924bobo581$
18516bo$18515b2o$18515bobo652$19169bo$19168b2o$19168bobo595$19763b3o$
19763bo$19764bo1129$20888b2o$20887b2o$20889bo655$21554bo$21553b2o$
21553bobo439$21998bo$21997b2o$21997bobo1165$23163b3o$23163bo$23164bo
1258$24427b2o$24427bobo$24427bo582$24999b2o$24999bobo$24999bo1018$
26021b2o$26021bobo$26021bo1213$27248b2o$27248bobo$27248bo1037$28296b2o
$28296bobo$28296bo628$28908b3o$28908bo$28909bo495$29417b3o$29417bo$
29418bo578$29994b2o$29993b2o$29995bo1281$31271bo$31270b2o$31270bobo
1348$32597bo$32596b2o$32596bobo1043$33651b2o$33650b2o$33652bo920$
34569bo$34568b2o$34568bobo1137$35711bo$35710b2o$35710bobo1118$36835b2o
$36834b2o$36836bo693$37516bo$37515b2o$37515bobo1140$38659b2o$38658b2o$
38660bo466$39109b3o$39109bo$39110bo1137$40251b3o$40251bo$40252bo1038$
41300b2o$41300bobo$41300bo1276$42569b2o$42568b2o$42570bo379$42938b3o$
42938bo$42939bo615$43556b2o$43556bobo$43556bo1190$44761b3o$44761bo$
44762bo1098$45865b2o$45865bobo$45865bo1164$47028b2o$47028bobo$47028bo
1039$48076b3o$48076bo$48077bo1106$49184b2o$49184bobo$49184bo1170$
50347b3o$50347bo$50348bo1295$51668bo$51667b2o$51667bobo620$52279b3o$
52279bo$52280bo1240$53523b2o$53523bobo$53523bo635$54159b2o$54158b2o$
54160bo1003$55166b2o$55166bobo$55166bo1018$56179bo$56178b2o$56178bobo
584$56764b3o$56764bo$56765bo567$57338b2o$57337b2o$57339bo1281$58621b2o
$58620b2o$58622bo757$59358bo$59357b2o$59357bobo630$59996b2o$59995b2o$
59997bo734$60715b2o$60714b2o$60716bo1161$61879b2o$61878b2o$61880bo968$
62836b2o$62836bobo$62836bo1073$63924b3o$63924bo$63925bo901$64823b2o$
64822b2o$64824bo1337$66157b2o$66156b2o$66158bo1215$67383b2o$67382b2o$
67384bo1038$68421bo$68420b2o$68420bobo1243$69673bo$69672b2o$69672bobo
641$70317bo$70316b2o$70316bobo1164$71490b2o$71489b2o$71491bo438$71941b
o$71940b2o$71940bobo644$72579bo$72578b2o$72578bobo581$73154bo$73153b2o
$73153bobo1123$74313b2o$74312b2o$74314bo1252$75577b3o$75577bo$75578bo
1210$76785b3o$76785bo$76786bo1125$77903b2o$77902b2o$77904bo664$78580b
2o$78580bobo$78580bo584$79161bo$79160b2o$79160bobo836$80008b2o$80007b
2o$80009bo850$80885bo$80884b2o$80884bobo659$81542bo$81541b2o$81541bobo
1281$82825bo$82824b2o$82824bobo1167$84000bo$83999b2o$83999bobo674$
84664b3o$84664bo$84665bo610$85270b2o$85270bobo$85270bo1298$86559b3o$
86559bo$86560bo1157$87726b2o$87726bobo$87726bo973$88703b2o$88702b2o$
88704bo1150$89854b2o$89853b2o$89855bo1073$90927b2o$90927bobo$90927bo
572$91524b2o$91523b2o$91525bo1073$92607bo$92606b2o$92606bobo657$93262b
2o$93261b2o$93263bo925$94174b3o$94174bo$94175bo320$94510bo$94509b2o$
94509bobo1020$95523b3o$95523bo$95524bo1353$96881b3o$96881bo$96882bo
1140$98019b2o$98019bobo$98019bo575$98601b2o$98601bobo$98601bo1003$
99597b2o$99597bobo$99597bo624$100235b2o$100235bobo$100235bo987$101226b
3o$101226bo$101227bo1284$102519b2o$102519bobo$102519bo!

and turn it into the optimized pattern and data quoted above. All gliders are assumed to be traveling northwest and aimed at a single intiial block.

Fair warning: as is fairly common in my scripts, this code rudely clobbers the clipboard with output data at the end of the run. Add a g.note() ahead of the g.setclipstr() if you want to be warned when that data will show up.
User avatar
dvgrn
Moderator
 
Posts: 5356
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI

Re: Thread For Synthesisable Spaceship Guns

Postby Sokwe » June 30th, 2018, 4:14 am

I removed another column from the p46 Coe ship gun by modifying the gun in the upper right corner:
#C p46 Coe ship gun
#C Original gun design by Dieter Leithner, 25 Nov 1995.
#C Major improvements by Stephen Silver (Nov 1996)
#C and Tanner Jacobi (Nov 2017).
#C Minor Improvements by Aidan F. Pierce and Matthias Merzenich.
x = 105, y = 87, rule = B3/S23
22bo9b2o5b2o$21bobo8b2o5b2o39b4o$21bobo32bo7b2o14bo2b2o$20b2ob2o30bobo
6b2o15bo2b2o$21bobo31bobo23bo2bo4bo$20b2ob2o29b2ob2o23b2o5b3o$21bobo8b
3o3b3o14bobo8bo3bo21bo$20b2ob2o7bo2bobo2bo14bobo7bobobobo10b2o5b3o$31b
o3bobo3bo13bobo5b2o2bobo2b2o7bo2bo4bo$32bo2bobo2bo13b2ob2o4b2o7b2o7bo
2b2o$18b2o5b2o7bo3bo24b2o2bobo2b2o6bo2b2o$32b2o5b2o24bobobobo8b4o$17bo
9bo3b3o5b3o11bo5bo6bo3bo30b2o$17bo3bobo3bo3b3o5b3o10b2o5b2o40b2o$17bo
3bobo3bo23bob2o3b2obo$18bobo3bobo24bob2o3b2obo18b2o7b3o$19bo5bo26b3o3b
3o18bo2bo4bo4bo9b2o$52b3o3b3o18bo2bo4bo5bo8b2o$79bo3bo8bo$90b2o$80b2ob
o$81bobo6b2o$82b2o8bo$87bo5bo8b2o$70bobo14bo4bo9b2o$10b2o20bo8b2obo25b
2o5bob2o8b3o$11bo21b2o6b2ob3o24bo3b3ob2o$9bo8b2o12b2o13bo26bo26b2o$9b
2o7b2o21b2ob3o28b3ob2o20b2o$42bobo7b2o5b2o16bobo2bo$3b2o8bo28bobo7b2o
5b2o20b2o$4bo9bo28bo$2bo7bo2bo$2b2o51bo44b2o$9bo43bo3bo45bo$2b2o11b2o
14b5o22bo17b6o9b2o3b2o6bo$2bobo6b3ob3o12bo4bo17bo4bo8bo7bo5bo11bo2bo7b
o$3bo11b2o18bo7bobo8b5o6b3o7bo5bo8b2ob12o$3o6bo20bo3bo9b2o21bo8bo3bo9b
3ob2o2b2o$o31bo11bo24b2o7bo13bobo$7b2ob4o55b2o7b2o13bo$8bob5o9b3o29b2o
19b4o21b2o$10bo2bo10b3o27b2ob2o18b2ob2o18b2ob2o$10b3o10bo3bo7b2o17b4o
21b2o19b4o$11bo11b2ob2o7b2o18b2o44b2o$17b2o$10b2o4bobo$6b2o2b2o4bo19b
2o45b2o$5bobo7b2o19bo47bo$5bo31b3o44bob2ob2o$4b2o13b2o4bo13bo45bobobo
2bo$19bo2bobobo25b3o8b2o7bo18b2o$14bo6b2ob2obo24bo10bobo6b3o11bo$14b3o
10bo25bo9bo11bo19b2o$17bo9b2o10bo6b2o26b2o10bo8bo$16b2o21b2o6bo45bobo$
11b2o25bobo6bobo35bo2bo4b2o$12bo35b3ob2o21b2o8b3o$10bo39b2obo21b2o$10b
2o38b3o46b2o$51b5o43bo$10b2o4bo9b2o25b3o41bobo$10bobob2ob2o6bo2bo21b2o
12b2o27b2o2b2o$11bo2b2ob2o5b6o20b2o2b2o8bobo7b3o8bo7b2o$8b3o14bo2bo23b
4o8bo9bo9b3o$8bo17b2o14bo7bo4bo19bo$42b3o5b3ob2o42b2o$32bo12bo6bo2bo3b
o24b3o10bo$31b3o10bobo7b2o2b2o25bo11b3o$30bo13b2o8bo4bo36b2o$31b2o35bo
28b2o5bo$44b2o21b3o15b2o7bo2b2o3b3o$18b2o24bo21b5o14b2obo6b2o4bo$14b2o
2b2o26bo18bo5bo14bobo11bobo$13bobo29b2o17b2o5b2o14bo13b2o$13bo27b2o7b
2o5b2o4b2o7b2o4b2o$12b2o6b2obo9bo7b2o8bo5b2o5bobo3bobo3bo2bo21b2o$20bo
b2o8bo15b3o14b2o3b2o4b2o24bo$32bo2bo12bo50b3o$33b5o4b2o12b2o41bo$33b2o
bobo3bo14bo$36bobo4b3o8b3o37b2o$25b2o4bo13bo8bo13bo4b2o20bo$25bo2bobob
o34bobobo2bo18bo$27b2ob2obo32bob2ob2o20b2o$33bo32bo$33b2o30b2o!

I also replaced the twin bees-based gun in the bottom left corner with Heinrich Koenig's gun to reduce the bounding diamond without affecting the bounding box.
-Matthias Merzenich
Sokwe
Moderator
 
Posts: 1414
Joined: July 9th, 2009, 2:44 pm

Previous

Return to Patterns

Who is online

Users browsing this forum: No registered users and 8 guests