How about a crab synthesis?

For discussion of specific patterns or specific families of patterns, both newly-discovered and well-known.
HartmutHolzwart
Posts: 422
Joined: June 27th, 2009, 10:58 am
Location: Germany

How about a crab synthesis?

Post by HartmutHolzwart » December 18th, 2014, 3:28 pm

The crab is the second smallest diagonal spaceship

Code: Select all

x = 13, y = 12, rule = B3/S23
8b2o$7b2o$9bo$11b2o$10bo2$9bo2bo$b2o5b2o$2o5bo$2bo4bobo$4b2o2bo$4b2o!
Why not start with to cheap one time glider turners for creating the two gliders in front at the right position and perturbing them to create the following tagalong.

User avatar
Extrementhusiast
Posts: 1796
Joined: June 16th, 2009, 11:24 pm
Location: USA

Re: How about a crab synthesis?

Post by Extrementhusiast » December 18th, 2014, 8:45 pm

What about using a clock plus a domino spark?

Code: Select all

x = 5, y = 6, rule = B3/S23
2o2$2bo$3b2o$b2o$3bo!
What I'm more concerned about with is the middle.
I Like My Heisenburps! (and others)

User avatar
Freywa
Posts: 589
Joined: June 23rd, 2011, 3:20 am
Location: Singapore
Contact:

Re: How about a crab synthesis?

Post by Freywa » December 18th, 2014, 10:04 pm

You can't just use a domino spark on a clock to form the front gliders as the back part would intervene. What I would suggest is to first synthesise the back part as a stationary constellation, then use various kickback reactions to add the front gliders while simultaneously firing up the back. But first we have to understand what the very middle component (hemmed in by two blocks) is.
Princess of Science, Parcly Taxel

User avatar
Extrementhusiast
Posts: 1796
Joined: June 16th, 2009, 11:24 pm
Location: USA

Re: How about a crab synthesis?

Post by Extrementhusiast » December 18th, 2014, 10:43 pm

Freywa wrote: But first we have to understand what the very middle component (hemmed in by two blocks) is.
It's a LOM predecessor.
I Like My Heisenburps! (and others)

chris_c
Posts: 906
Joined: June 28th, 2014, 7:15 am

Re: How about a crab synthesis?

Post by chris_c » December 19th, 2014, 10:37 am

The clock inserter is very nice. It will come in handy for a problem discussed in another thread, but sticking with the current topic, here is a partial crab synthesis. You "simply" need to turn on the red cells at generation 25.

While this may sound hopeful I'm not yet sure it is completely impossible: there is one lane available for SE gliders to fly between the clocks and 3 lanes available for NW gliders in the bottom right. Plus there is room for some kind of bait still life to sit between the clocks somewhere. With a bit of searching and a bit of luck who knows?

Code: Select all

x = 36, y = 37, rule = LifeHistory
18.A$18.A.A$18.2A2$30.A$30.A.A$15.2A13.2A$15.2A3$19.A$17.A.A$18.A.A$
18.A3$6.2A$6.2A11.D$.2A8.A6.2D13.3A$A.A9.2A3.D15.A$2.A7.2A5.D.D8.2A4.
A$12.A5.D8.2A$29.A6$20.2A$19.2A$5.2A14.A$4.A.A$6.A2$17.3A$17.A$18.A!
EDIT: Here are some random looking predecessors:

Code: Select all

x = 388, y = 21, rule = B3/S23
196bo$190b2o4bo$13bo176bobo3b2obo$7b2o4bo35bo140bo7b2o$7bobo3b2obo26b
2o4bo51bo46bo45b2o45bo$7bo7b2o26bobo3b2obo42b2o4bo40b2o4bo44b2o40b2o4b
o$11b2o30bo7b2o42bobo3b2obo37bobo3b2obo37b3o3bo39bobo3b2obo30bo32bo$
10b2o35b2o46bo7b2o37bo7b2o83bo7b2o24b2o4bo26b2o4bo33bo$7bo4bo33b2o51b
2o45b2o35b2o6b3o45b2o28bobo3b2obo23bobo3b2obo24b2o4bo41bo$8bo35bo3bo
49b2o45b2o36bobo2bob2obo44b2o29bo7b2o23bo7b2o24bobo3b2obo32b2o4bo$2o5b
2o32bo53bo4bo40bobo3bo35bo5bobo42bo5bo32b2o31b2o28bo7b2o32bobo3b2obo$o
bo4bo28b2o5bobo50bo89bo4bo44bo35b2o31b2o33b2o36bo7b2o$o5bobo27bobo3b2o
44b2o7bo37b2o5b2o42b2o40b2o5b2o31bobo3bo32bo31b2o41b2o$3bo3bo28bo5bobo
43bobo3b2o39bobo3bob3o82bobo4bo100bo4bo39b2o$3b2o34bo4bo43bo5b3o38bo5b
obo84bo5bobo25b2o5b2o24b2o5b3o74bo3bo$39b2o50bo46bo3bo88bo3bo26bobo2bo
2b3o22bobo4bo26b2o6b2o37bobo$91b2o45b2o91b2o29bo5bobo24bo5bobobo23bobo
3b2o34b2o7bo$265bo3bo28bo3bo26bo5b3obo31bobo3b2o$265b2o31b2o32bo38bo5b
3o$332b2o40bo$374b2o!
And here are some more from one generation further back. I haven't had any luck in making a proper synthesis but maybe this can give someone some ideas.

Code: Select all

x = 448, y = 39, rule = B3/S23
13bobo30bobo28bobo$8b2o3b2o26b2o3b2o24b2o3b2o35bobo$6b2o6bob3o20b2o6bo
b3o18b2o6bob3o26b2o3b2o76bobo$8bo7b2o23bo7b2o21bo7b2o25b2o6bob3o33bobo
31b2o3b2o$11b2o31b2o29b2o32bo7b2o29b2o3b2o30b2o6bob3o$11bobo30bobo28bo
bo34b2o32b2o6bob3o28bo7b2o36bobo$6bo4bo26bobo3bo25bo4bo36bobo33bo7b2o
32b2o36b2o3b2o$7b2o29b3o30b2o34bo4bo38b2o37bobo33b2o6bob3o32bobo$bo3bo
b2o25bo6b2o22bo3bob2o35b2o41bobo31bo4bo37bo7b2o28b2o3b2o32bobo$2o4b2ob
o23b2o3b4o22b2o4b2obo28bo3bob2o36b2o3bo34b2o43b2o31b2o6bob3o23b2o3b2o$
obo30bobo6bo21bobo34b2o3bo41bo31bo4b2obo42bobo32bo7b2o22b2o6bob3o$7bo
63bo2bo26bobo4bobo30bo3bob2o30b2o4b2obo36b3o3bo37b2o29bo7b2o$3b2o3bo
27b2o29b2o4bo34bo31b2o4b2obo29bobo43b3o41bobo31b2o33bobo$3bobo30bobo
28bobo34b2o3bo30bobo43bo34bo4bo36bo5bo33bobo27b2o3b2o$ob2o29bob2o27bob
2o36bobo40bo34b2o36b2o3bobob2o32b4o31bo4bo27b2o6bob3o26bobo$3o30b3o28b
3o34bob2o38b2o37bobo35bobo3bobo30bo4bo33bobo32bo7b2o22b2o3b2o31bobo$b
2o31b2o29b2o34b3o39bobo33bob2o45bobo27b2o4b2ob2o24bo6bo35b2o25b2o6bob
3o22b2o3b2o$obo30bobo28bobo35b2o36bob2o35b3o41b2o3bo29bobo31b2o5bobo
34bobo26bo7b2o21b2o6bob3o$obo30bobo28bobo34bobo36b3o37b2o41bobo39bo26b
obo3b2o30bo5bo31b2o28bo7b2o34bobo$o32bo30bo36bobo37b2o36bobo38bob2o37b
2o37bo29b4o34bobo30b2o34b2o3b2o$bo32bo30bo35bo38bobo36bobo38b3o38bobo
31b2o3bo25bo4bo31bo4bo32bobo31b2o6bob3o$102bo37bobo36bo41b2o35bob2o33b
obo27b2o3bob2obo27bobo35bo35bo7b2o$140bo39bo39bobo35b3o31bob2o29bobo
30bo6bo29bo44b2o$141bo78bobo36b2o31b3o37bo24b2o5bobo24bo6b2o40bobo$
220bo37bobo32b2o33b2o3bo23bobo3b2o25b2o3b3o2bo33b3o3bo$221bo36bobo31bo
bo33bobo35bo23bobo5bo35b2obo$258bo33bobo30bob2o31b2o4bo30b2o31bo4bo$
259bo32bo32b3o32bobo30b2o3b2o29b2o3b2ob3o$293bo32b2o29bob2o32bobo33bob
o5bo$325bobo29b3o30bob2o45bo$325bobo30b2o30b3o39b2o3b2o$325bo31bobo31b
2o39bobo$326bo30bobo30bobo36bob2o$357bo32bobo36b3o$358bo31bo39b2o$391b
o37bobo$429bobo$429bo$430bo!

unname66609
Posts: 87
Joined: December 20th, 2014, 8:30 am

Re: How about a crab synthesis?

Post by unname66609 » December 24th, 2014, 5:22 am

Code: Select all

x = 19, y = 21, rule = B3/S23
13bobo$8b2o3b2o$6b2o6bob3o$8bo7b2o$11b2o$11bobo$11bo$5bo$bo6b2o$2o3b3o
2bo$obo5bo$7b2o$3b2o3b2o$3bobo$ob2o$3o$b2o$obo$obo$o$bo!
Here is error crab predecessor problem.

User avatar
simsim314
Posts: 1702
Joined: February 10th, 2014, 1:27 pm

Re: How about a crab synthesis?

Post by simsim314 » December 24th, 2014, 8:50 am

It seems that having SL to base on the synth would be a nice next step.

chris_c
Posts: 906
Joined: June 28th, 2014, 7:15 am

Re: How about a crab synthesis?

Post by chris_c » December 24th, 2014, 9:17 am

unname66609 wrote:

Code: Select all

x = 19, y = 21, rule = B3/S23
13bobo$8b2o3b2o$6b2o6bob3o$8bo7b2o$11b2o$11bobo$11bo$5bo$bo6b2o$2o3b3o
2bo$obo5bo$7b2o$3b2o3b2o$3bobo$ob2o$3o$b2o$obo$obo$o$bo!
Here is error crab predecessor problem.
Oh yeah, looks like that one slipped through. It can be fixed by adding another glider at the back but that probably makes it even more useless than before:

Code: Select all

x = 19, y = 21, rule = B3/S23
13bobo$8b2o3b2o$6b2o6bob3o$8bo7b2o$11b2o$11bobo$11bo$5bo$bo6b2o$2o3b3o
2bo$obo5bo$7b2o$3b2o3b2o$3bobo$ob2o$3o8b2o$b2o8bobo$obo8bo$obo$o$bo!

User avatar
Kazyan
Posts: 864
Joined: February 6th, 2014, 11:02 pm

Re: How about a crab synthesis?

Post by Kazyan » December 25th, 2014, 7:44 pm

Code: Select all

x = 15, y = 17, rule = B3/S23
bo$2bo$3o$4b2o$4bobo2$6bobo$3bo3b2o$2b2o$3bo3b2o$3bo3bo$2b2o6bo$3bo5b
2o2$12b2o$12bobo$12bo!
Eh, it's an idea. If the upper right clock inserter can be replaced with something else from the splitters thread (so it doesn't interfere with the bipole), and we can find a reaction that produces a domino spark along with the lower-left elbow/block in the right position, this could work.

EDIT: Something along these lines could work too, but the upper object would be tricky to make from one angle without breaking the beacon mid-formation.

Code: Select all

x = 8, y = 13, rule = B3/S23
2o2$2bo$3o2$b2o$bo$4bo$3b2o2$5b3o$5bo$6bo!
Tanner Jacobi

User avatar
biggiemac
Posts: 504
Joined: September 17th, 2014, 12:21 am
Location: California, USA

Re: How about a crab synthesis?

Post by biggiemac » December 25th, 2014, 8:45 pm

This only relies on a single spark.

Code: Select all

x = 14, y = 14, rule = B3/S23
$2bo5bo$3bo2bo$b3obobo$6b2o2$6b2o$6b2o$8b2o$8b2o2$12bo$11b2o$11bobo!
Edit: Never mind, its evolution conflicts with the already-present gliders.
Physics: sophistication from simplicity.

User avatar
Kazyan
Posts: 864
Joined: February 6th, 2014, 11:02 pm

Re: How about a crab synthesis?

Post by Kazyan » December 26th, 2014, 1:42 am

biggiemac wrote:This only relies on a single spark.

Code: Select all

x = 14, y = 14, rule = B3/S23
$2bo5bo$3bo2bo$b3obobo$6b2o2$6b2o$6b2o$8b2o$8b2o2$12bo$11b2o$11bobo!
Edit: Never mind, its evolution conflicts with the already-present gliders.

Converting the boat into a beehive (so, what the spark does) means that the spark doesn't need to be there at that particular time:

Code: Select all

x = 13, y = 13, rule = B3/S23
bo$2bo2b2o$3obo2bo$5b2o2$5b2o$5b2o$7b2o$7b2o2$11bo$10b2o$10bobo!
...but that still means the rightmost cell of the beehive interferes with one of the gliders of the right elbow. I have a vague idea for getting around that one, but it will almost certainly bump into the other clock:

Code: Select all

x = 15, y = 19, rule = B3/S23
$9bo$7bobo$8bobo$8bo3$7b2o$9bo$bo5b3o$2b2o$2o6b2o$2bo5bo$11bo$10b2o2$
12b3o$12bo$13bo!
But, hey, if we throw around enough half-plausible ideas, hopefully one of them will work by accident. That's basically how search programs work, after all.

Code: Select all

#C Delete the left two bits of the cap and at generation 2 and create a glider in the specified location at generation 4.
#C Somehow.
x = 17, y = 12, rule = LifeHistory
7.2A5.3C$6.C2.A6.C$.2D3.C3A4.3C$2D12.C$2.D5.2A4.3C$8.A$11.A$3.D.D4.2A
$3.D.D$3.3D7.2A$5.D7.A.A$5.D7.A!
Tanner Jacobi

User avatar
Extrementhusiast
Posts: 1796
Joined: June 16th, 2009, 11:24 pm
Location: USA

Re: How about a crab synthesis?

Post by Extrementhusiast » December 26th, 2014, 5:21 pm

Forming them simultaneously?

Code: Select all

x = 11, y = 8, rule = B3/S23
2o$o$b3o$7b3o$6b3o$2b3o2b4o2$2b3o!
There is also this way, but it still needs the spark on the right:

Code: Select all

x = 17, y = 14, rule = B3/S23
6bo$7bo$5b3o2$8b2o$3o4bobo$2bo4bo2b2o$bo4b2o3bo$11bobo$12b2o2$14b2o$
14bobo$14bo!
While messing with that, I found this predecessor:

Code: Select all

x = 5, y = 6, rule = B3/S23
bo$2o$obo$4bo$4bo$3bo!
...which could imply something from a toad.

EDIT: Just found this simple spark that does the trick:

Code: Select all

x = 7, y = 8, rule = B3/S23
bo$2bo$obo$bo$bo2bo$3bo2bo$3bo2bo$5bo!
EDIT 2: One side done:

Code: Select all

x = 22, y = 15, rule = B3/S23
5bo7bo$6b2o6bo$5b2o5b3o2$19bo$10b2o6bobo$b2o6bobo6b2o$obo3b2o2bo$2bo3b
ob2o3bo4b2o$12bo2bo2bo$12bo2bo5bo$14bo5b2o$9b2o$8b2o$10bo!
However, this might require a slight redesign in terms of getting the center portion to where it is, if the top-right block-glider combo doesn't come out nicely.

EDIT 3: And there we go:

Code: Select all

x = 30, y = 25, rule = B3/S23
18bo$16b2o$17b2o2$15bo11bo$13bobo9b2o$14b2o10b2o2$25bo$18bo5b2o$16bobo
5bobo$17bobo$6bo5bo4bo4bo5b2o$4bobo6b2o6bobo3b2o$5b2o5b2o7b2o6bo$18bo$
bo7b2o6bobo$b2o5bobo6b2o$obo2b2o2bo15b3o$5bob2o8b2o6bo$11b3o3b2o7bo$
12b3o4b2o$7b2o10b2o$7bobo$7bo!
The initial debris is most likely synthesizable; I shall check that.

EDIT 4: The initial debris is indeed synthesizable.
I Like My Heisenburps! (and others)

chris_c
Posts: 906
Joined: June 28th, 2014, 7:15 am

Re: How about a crab synthesis?

Post by chris_c » December 26th, 2014, 8:52 pm

Extrementhusiast wrote:And there we go:

Code: Select all

x = 30, y = 25, rule = B3/S23
18bo$16b2o$17b2o2$15bo11bo$13bobo9b2o$14b2o10b2o2$25bo$18bo5b2o$16bobo
5bobo$17bobo$6bo5bo4bo4bo5b2o$4bobo6b2o6bobo3b2o$5b2o5b2o7b2o6bo$18bo$
bo7b2o6bobo$b2o5bobo6b2o$obo2b2o2bo15b3o$5bob2o8b2o6bo$11b3o3b2o7bo$
12b3o4b2o$7b2o10b2o$7bobo$7bo!
Congratulations! I just found this predecessor by random search. I wonder if it can be of any use in the optimisation game?

Code: Select all

x = 7, y = 6, rule = B3/S23
2o3bo$obob3o$bobo$4bo$4bo$6bo!
EDIT: Hmmm, no probably not. The boat part of that predecessor interacts with the rest of the synthesis in a way that the clock inserter method avoids.
Last edited by chris_c on December 26th, 2014, 9:07 pm, edited 1 time in total.

Sokwe
Moderator
Posts: 1480
Joined: July 9th, 2009, 2:44 pm

Re: How about a crab synthesis?

Post by Sokwe » December 26th, 2014, 10:29 pm

Congratulations! Here is a substantial reduction of one side:

Code: Select all

x = 27, y = 28, rule = B3/S23
15bo$13b2o$14b2o2$10bo13bo$8bobo11b2o$9b2o12b2o4$14bo7bo$12bobo6b2o$7b
o5bobo5bobo$8b2o3bo4bo$7b2o8bobo5b2o$17b2o5b2o$14bo11bo$o12bobo$b2o10b
2o$2o$13b2o7b3o$13b2o7bo$6b2o7b2o6bo$7b2o6b2o$6bo$9b2o$9bobo$9bo!
Edit: Can anyone find a way to construct the related tubstretcher?

Code: Select all

x = 13, y = 15, rule = B3/S23
8b2o$7b2o$9bo$11b2o$10bo2$9bo2bo$b2o5b2o$2o5bo$2bo4bobo$4b2o2bo$4b2o$
8bo$7bobo$8bo!
Edit 2: Here is a continuous 3-sided synthesis, just to "prove" that a gun could be constructed:

Code: Select all

x = 98, y = 100, rule = B3/S23
86bo$84b2o$85b2o$71bobo$71b2o22bo$72bo20b2o$64bobo27b2o$64b2o$65bo6$
73bobo$73b2o$74bo2$85bobo$85b2o$86bo2$73bobo$73b2o$74bo4$74bo$72b2o$
73b2o13$62bo$61bo$61b3o19$22b2o$23b2o$22bo$9b3o$11bo55b2o$10bo56bobo$
67bo$32bo27bo$32b2o25b2o$8b2o21bobo25bobo16b2o3b2o$7bobo7b3o57b2o4bobo
$9bo9bo59bo3bo$18bo$81bo$80b2o$80bobo$5b2o$4bobo$6bo86bo$92b2o$3o89bob
o$2bo$bo94b2o$95b2o$69b2o26bo$68b2o$70bo2$93b3o$93bo$5b2o87bo$6b2o$5bo
$80b2o$80bobo$80bo!
-Matthias Merzenich

HartmutHolzwart
Posts: 422
Joined: June 27th, 2009, 10:58 am
Location: Germany

Re: How about a crab synthesis?

Post by HartmutHolzwart » December 27th, 2014, 9:40 am

Congratulations!

I see there is significant progress in glider construction! Only I don't know exactly where it cones from!


Btw.: if we vould attach a tub to make the crab a tub stretcher, this could be used to make a nice quadratic growth pattern by building a c/2 crab tub stretcher rak.e

User avatar
Extrementhusiast
Posts: 1796
Joined: June 16th, 2009, 11:24 pm
Location: USA

Re: How about a crab synthesis?

Post by Extrementhusiast » December 27th, 2014, 1:18 pm

HartmutHolzwart wrote:I see there is significant progress in glider construction! Only I don't know exactly where it cones from!
Here are my notes, if it helps:

Code: Select all

x = 965, y = 561, rule = B3/S23
570bo$568bobo51b2o$569b2o53bo$573bo46b4o$571b2o42b3o$572b2o41bo6b2o$
616bo5b2o$619bo4b2o$618b2o4b2o$618bobo$615b2o10b2o$614bobo9b2o$616bo
11bo60bo$688bobo$687bo2bo$688b2o$908bo$713bobo183b3o5b2o$689b2o22b2o
184bo3b2o2bobo$678bo10bobo22bo185b5o$679b2o9b2o6bo164bo$678b2o12b2o2b
2o156b3o5b2o36b5o$692bobo2b2o155bo3b2o2bobo34bo3b2o$693b2o160b5o39b3o
2$855b5o$854bo3b2o52bo$854b3o54b2o$699b2o210bobo2$689b2o175b3o31b2o$
688bobo175bo32bobo$685b2o2bo177bo33bo$685bob2o3bo$691bo2bo163b2o$691bo
2bo164b2o$693bo15b3o146bo$674b2o33bo$673bobo34bo$675bo4$694b2o$693b2o$
695bo54$267b2o$266b2o$231b2o35bo$bo229bo38b2o$2bo229b3o34bo$3o83bo151b
3o$4b2o42b2o37bo2b2o102bo42b3o28bo2bo$4bobo43bo34b3obo2bo33bo62b2o2bo
39b3o2b4o18b2o5b2o$48b3o39b2o32bobo36b2o24bobob3o63b2o5bo$6bobo116bobo
35bobo24bo42b3o25bo4bobo$3bo3b2o40b2o39b2o33bo38bo98b2o2bo$2b2o41b2o2b
o36b2o2b2o171b2o$3bo3b2o36b2o5bo33b2o4b2o71b2o$3bo3bo43b2o39b2o30b2o
38bobo$2b2o6bo115bo39bo$3bo5b2o42b3o40bo21bo5b3o$53bo41b2o22b2o466bo$
12b2o40bo40bobo19b2o6b2o458bobo5bo35bo$12bobo104bo5bo456bo3b2o6bo2b2o
28bobo5bo$12bo115bo334bo118b2o5bo2b3obo2bo24bo3b2o6bo2b2o$127b2o334bob
o115bo3bo2bobo6b2o25b2o5b2ob3obo2bo$463b2o118b4o2bo33bo3bo2bobo6b2o$
129b3o452b2ob2o8b2o26b4o2bo$129bo326bo129b3o2b3o3b2o27b2ob2o8b2o$130bo
326b2o127b2o4b3o4b2o27b3o2b3o3b2o$456b2o5b2o121bobo10b2o27b2o4b3o4b2o$
463bo122bo41bobo10b2o$464bo163bo$229bo232bobo4b2o$230bo230bobo4b2o$
228b3o36bo55b4o134b2o7bo$266b2o29b2o25b3o123bo14b2o$231b2o33bobo28b2o
23bo2bo43bo81b2o11bo$223b3o4bobo37bo27b2o24bobo43bo33bobo43b2o15bo$
225bo4bo2b2o35bo27b2o24b2o14b2o26bobo34b2o58b2o53bo7bo$224bo4b2o3bo34b
o29bo20b3o2bo14b2o27bo35bo115b2o6bo$234bobo62bo22bo2bo2bo13bo26bo2bo
82b2o63b2o5b3o$235b2o60bob4o18bo5bo2bo9bo3bo26bo2bo71b2o6bobo$298b2ob
3o23bo2bo13bo26bo2bo35b2o33bobo3b2o2bo78bo$237b2o59bo30bo13bo29bo35bob
o35bo3bob2o3bo66b2o6bobo$237bobo166b2o2bo46bo2bo55b2o6bobo6b2o$237bo
168bob2o3bo43bo2bo54bobo3b2o2bo$412bo2bo43bo57bo3bob2o3bo4b2o$412bo2bo
38b2o71bo2bo2bo$414bo38b2o72bo2bo5bo$410bo44bo73bo5b2o$409b2o113b2o$
409bobo111b2o$525bo35$646bo$645bobo$644bo2bo2b2o$645b2o3bobo$651b2o$
653b2o$653bobo$654b2o7b2o$662bo2bo$537bo115bo9b2o$536bobo114b2o$535bo
2bo113bobo8b2o$536b2o125bo$666bo$665b2o$537b2o$537bobo$538b2o6bo$484bo
55b2o2b2o$485bo54bobo2b2o$483b3o55b2o2$472bo7bo187b2o$473b2o6bo63bo
122bobo$472b2o5b3o186bo2$649b2o$650b2o$649bo2$554b2o$553bo$492bo62bo
172b2o$483b2o6bobo9b2o222bobo$482bobo6b2o10bobo222bo$479b2o2bo19bo268b
2o$479bob2o3bo4b2o233bo$485bo2bo2bo232bobo44b2o$485bo2bo5bo230b2o46b2o
$487bo5b2o274b2o3bo$468b2o299bo$467bobo255b2o13b2o26bo$469bo254bo2bo
11b2o$725b2o14bo3$488b2o$487b2o$489bo39$527b2o$527bobo$524b2o2bo$523bo
bo$525bo9$573bo$573bobo$573b2o3$577b4o$571bobo3bo3bo$571b2o4bo$572bo5b
o2bo$562b2o$561bo$563bo2$569b2o$569bobo$569bo4$572bo9b2o$571b3o7b2o$
571bob2o8bo$572b3o$572b2o37$687bo2$685b2o64bo$684bo2bo61bobo$685bo2bo
61b2o$686b2o$749bo$748bobo59b2o$748b2o39bo$744bo39bo3b2o17b2o$743bobo
39b2obobo16bo5b3o$744bobo37b2o21bobo2bo$745bo65bo$811bo$789b2o20bo2bo$
789bobo21b2o$750b2o32b2o3bo$750bobo32bo$750bo34bo17$785bo$780bo3b2o$
781b2obobo$780b2o2$776bo$777b2o5b2o$776b2o3bo2bo$780bobobo$780b2o2bob
2o$784b2obo$780b2o$780b2o$782b2o$782b2o$521bo7bo$522b2o6bo$521b2o5b3o
2$540bo$538bobo$539bobo$539bo3$541bo$532b2o6bobo$531bobo6b2o$528b2o2bo
$528bob2o3bo4b2o$534bo2bo2bo$534bo2bo5bo$536bo5b2o39b2o$517b2o$516bobo
66bo$518bo67b2o$584b2o$586bo2$537b2o$536b2o$538bo33$610bo$611b2o249bo$
610b2o4bobo241b2o$617b2o242b2o$617bo11bo$630b2o$628b2o127bo$630bo125bo
$756b3o2$629b2o109bo25bo$628bo2bo109b2o22bo$620b2o7b2o109b2o23b3o$617b
2o2bo$617bob2o3bo4b2o$623bo2bo2bo$623bo2bo5bo217bo$625bo5b2o216bobo$
606b2o123bo7bo109b2o$605bobo124b2o6bo119bo$607bo123b2o5b3o118b2o$859bo
bo$750bo$751b2o37b2o71b2o$626b2o121b2o39bobo69b2o$625b2o124bo3bo34bo3b
o69bo$627bo126bobo36b2o$754b2o38b2o$751bo12b2o21b2o$742b2o6bobo11bobo
9bo15bo3b3o61b3o$741bobo6b2o12bo11bo6b2o5b2o4bo63bo$738b2o2bo33bo6bobo
3bo7bo63bo$738bob2o3bo4b2o15b3o13bo6b2o$744bo2bo2bo16bo18bo3b2o$744bo
2bo5bo14bo10bo6b2o4b2o$746bo5b2o26bo11b2o$727b2o50bo$726bobo37bo$728bo
36b2o$765bobo3$747b2o$746b2o$748bo27$962bo$961bo$961b3o2$945bo$946b2o$
945b2o$856b2o2$858bo$806bo51bo$804b2o52b3o$805b2o49bo2b2o75bo7bo$854b
3o80b2o6bo$821b3o29bo82b2o5b3o$801bo22bo28b2o$800bobob4o12bo3bo130bo6b
2o$800b2o2bo2bo12bo135b2o4b2o$820bo133b2o$821b2o133bo3b4o$804b2o153bo
4bo$804bobo152b2o2b2o$804bo151bo$947b2o6bobo$946bobo6b2o$943b2o2bo$
872bobo68bob2o3bo4b2o$872b2o75bo2bo2bo$873bo75bo2bo5bo$876bo74bo5b2o$
871b2o2b2o55b2o$871b2o2bobo53bobo$933bo$869b4o$868bo4bo$868b2o2b2o$
952b2o$951b2o$953bo!
I Like My Heisenburps! (and others)

User avatar
simsim314
Posts: 1702
Joined: February 10th, 2014, 1:27 pm

Re: How about a crab synthesis?

Post by simsim314 » December 27th, 2014, 6:24 pm

Congrats! This is really amazing!

If anyone finds appropriate period and gun, I can modify my gun placing script to work with it.

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

Re: How about a crab synthesis?

Post by dvgrn » December 27th, 2014, 9:26 pm

simsim314 wrote:If anyone finds appropriate period and gun, I can modify my gun placing script to work with it.
I was figuring on waiting a few days to see if the recipe got any simpler... anyway it's someone else's turn to decide on the Official Crab Gun Optimization Rules: clearly there are recipes with fewer gliders than Sokwe's three-sided synthesis, but because crabs travel diagonally, gliders from the fourth direction would tend to slow down the repeat rate significantly -- it takes a while for newly constructed crabs to crawl out of the way of even one or two SE-facing glider inserters.

So the current 27-glider recipe seems like a pretty good compromise between number of gliders and repeat rate, which is 165 ticks for the current recipe -- at least, I didn't see any easy improvements, and I'm not motivated to look hard for such things because faster repeat rates make it significantly more difficult to build the gun.

It should be easy enough to build a 165-tick bootstrapped Herschel factory along the same lines as the p160 edge shooters -- though it will be necessary to use just Snarks and the much larger P5 domino-spark reflectors to build the loops. So a p165 edge shooter will turn out maybe 20% or 30% bigger than the p160. If the period can be reduced to 161 or 162, we could use p7 or p6 reflectors instead.

User avatar
codeholic
Moderator
Posts: 1142
Joined: September 13th, 2011, 8:23 am
Location: Hamburg, Germany

Re: How about a crab synthesis?

Post by codeholic » December 27th, 2014, 9:31 pm

I wonder, if it is possible to build a p165 gun out of, say, 92P33.1 and a couple of pentadecathlons.

Though it's not gonna be an edge-shooter anyway...
Ivan Fomichev

Sokwe
Moderator
Posts: 1480
Joined: July 9th, 2009, 2:44 pm

Re: How about a crab synthesis?

Post by Sokwe » December 28th, 2014, 1:53 am

dvgrn wrote:It should be easy enough to build a 165-tick bootstrapped Herschel factory along the same lines as the p160 edge shooters -- though it will be necessary to use just Snarks and the much larger P5 domino-spark reflectors to build the loops. So a p165 edge shooter will turn out maybe 20% or 30% bigger than the p160. If the period can be reduced to 161 or 162, we could use p7 or p6 reflectors instead.
As Codeholic noted, we can make use of the p15 pentadecathlon-based reflectors in building such a gun.
dvgrn wrote:So the current 27-glider recipe seems like a pretty good compromise between number of gliders and repeat rate, which is 165 ticks for the current recipe
That was the idea. I didn't do much to optimize the repeat time, as I still suspect that the synthesis could still be significantly reduced (possibly by a more direct synthesis of the middle component together with the 3-glider synthesis of the wing on the other side).
-Matthias Merzenich

User avatar
codeholic
Moderator
Posts: 1142
Joined: September 13th, 2011, 8:23 am
Location: Hamburg, Germany

Re: How about a crab synthesis?

Post by codeholic » December 28th, 2014, 8:00 pm

Sokwe wrote:As Codeholic noted, we can make use of the p15 pentadecathlon-based reflectors in building such a gun.
Are there known color-changing pentadecathlon-based glider reflectors? The common one that consists of two pentadecathlons is color-preserving.
Ivan Fomichev

User avatar
Extrementhusiast
Posts: 1796
Joined: June 16th, 2009, 11:24 pm
Location: USA

Re: How about a crab synthesis?

Post by Extrementhusiast » December 28th, 2014, 8:13 pm

codeholic wrote:
Sokwe wrote:As Codeholic noted, we can make use of the p15 pentadecathlon-based reflectors in building such a gun.
Are there known color-changing pentadecathlon-based glider reflectors? The common one that consists of two pentadecathlons is color-preserving.
Not that I know of.

EDIT: There's actually the p15 variant of that reflector:

Code: Select all

x = 21, y = 17, rule = B3/S23
10b2o6b2o$9bo2bo4bo2bo$9bo2bo4bo2bo$o8bo2bo4bo2bo$3o7b2o6b2o$3bo$2b2o$
13bo2bo$5bo5b3o2b3o$4bobo3bo8bo$2o2b2o5b2o4b2o$2o10bo4bo3$2b2o$3b2o$2b
o!
I Like My Heisenburps! (and others)

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

Re: How about a crab synthesis?

Post by dvgrn » December 28th, 2014, 10:51 pm

Extrementhusiast wrote:EDIT: There's actually the p15 variant of that reflector...
Oh, yeah. Karel Suhajda hadn't found that yet, last time I was doing any serious gun-building. Here's a small bootstrapped-Herschel edge shooter -- period 390:

Code: Select all

#C p390 edge shooter using p15N reflectors
x = 96, y = 64, rule = B3/S23
67b2o3$65bo4bo$63b2ob4ob2o$53bo11bo4bo$21b2o3b2o25b3o$21b2o2bob3o26bo$
25bo4bo24b2o$21b4ob2o2bo$21bo2bobobob2o26bo4b3o4b3o$24bobobobo26bobob
6o2b6o$25b2obobo22b2o2b2o4b3o4b3o$29bo23b2o2$15b2o$3b3o10bo7b2o$2bo3bo
3b3o3bobo5b2o$bo5bo2b3o4b2o2$o7bobobo$o7bobobo2$bo5bo2b3o$2bo3bo3b3o$
3b3o21b2o17b2o$27bo19b2o$28b3o15bo$16bo8bo4bo$10b2o4b2o5b3o24bo$9bo2bo
2bobo4bo27b3o$11b2o9b2o29bo$7bo44b2o$6bob2o52b2o18b2o5b2o$6bo5b2o48bo
19b2o5bo$5b2o5b2o46bobo24bobo$54b2o4b2o25b2o$53bo2bo26b2o$54b2o27bobo$
42b2o40bo$42b2o47bo$64bo26bo$64b3o16b3o$18b3o33bo12bo23bo$10b2o4b2obo
33bobo10b2o14bo3bo3bobo$10b2o4b3o34bobo27b3o$54bo35b3o$95bo$15bobo33b
2o3b2o37bo$14bob2o13b2o19bo3bo33b3o$15bo15bobo15b3o5b3o23b3o$16bo16bo
15bo9bo16b2o4bo3bo3bobo$16b2o15b2o34b2o5bobo12bo$18b2o49b2o7bo4b3o$18b
ob2o56b2o11bo$14bo3bo2bo69bo$15b2obobo44bo$17b3o44bobob2o$64bobobobo$
63b2obobobo2bo$64bo2b2ob4o$22bo41bo4bo$23bo41b3obo2b2o$21b3o43b2o3b2o!
This may not seem terribly relevant, but it's easy enough to adjust it to make a p165. Just have to add more signals to the loop --

Code: Select all

#C p195 edge shooter
x = 96, y = 64, rule = B3/S23
67b2o3$65bo4bo$63b2ob4ob2o$53bo11bo4bo$21b2o3b2o25b3o$21b2o2bob3o26bo$
25bo4bo24b2o$21b4ob2o2bo$21bo2bobobob2o26bo4b3o4b3o$24bobobobo26bobob
6o2b6o$25b2obobo22b2o2b2o4b3o4b3o$29bo23b2o2$15b2o$3b3o10bo7b2o$2bo3bo
3b3o3bobo5b2o$bo5bo2b3o4b2o2$o7bobobo$o7bobobo2$bo5bo2b3o$2bo3bo3b3o$
3b3o21b2o17b2o$27bo19b2o$28b3o15bo$16bo8bo4bo$10b2o4b2o5b3o24bo$9bo2bo
2bobo4bo27b3o$11b2o9b2o29bo$7bo44b2o$6bob2o52b2o18b2o5b2o$6bo5b2o48bo
19b2o5bo$5b2o5b2o46bobo24bobo$54b2o4b2o25b2o$53bo2bo26b2o$54b2o27bobo$
42b2o40bo$42b2o47bo$64bo26bo$64b3o16b3o$18b3o33bo12bo23bo$10b2o4b2obo
33bobo10b2o14bo3bo3bobo$10b2o4b3o34bobo10bo3bo12b3o$54bo16bo18b3o$66bo
5bo22bo$15bobo33b2o3b2o7bo3bo3bo21bo$14bob2o13b2o19bo3bo8bo2bobo2bo16b
3o$15bo15bobo15b3o5b3o5bo3bo3bo9b3o$16bo16bo15bo9bo6bo5bo3b2o4bo3bo3bo
bo$16b2o15b2o32bob3o4bobo12bo$18b2o48b3o7bo4b3o$18bob2o56b2o11bo$14bo
3bo2bo69bo$15b2obobo44bo$17b3o44bobob2o$64bobobobo$63b2obobobo2bo$64bo
2b2ob4o$22bo41bo4bo$23bo41b3obo2b2o$21b3o43b2o3b2o!
and keep adding 8N ticks to the loop until it's a multiple of 165:

Code: Select all

#C p165 = p(390+8*75)/6 edge shooter
x = 171, y = 139, rule = B3/S23
142b2o3$140bo4bo$138b2ob4ob2o$128bo11bo4bo$128b3o$131bo$130b2o2$133bo
4b3o4b3o$132bobob6o2b6o$128b2o2b2o4b3o4b3o$128b2o4$129bo$129b2o$128bob
o14$157b2o5b2o$157b2o5bo$162bobo$162b2o$158b2o$158bobo$159bo$166bo$
166bo$158b3o$166bo$157bo3bo3bobo$158b3o$165b3o$170bo$170bo$165b3o$158b
3o$140bo16bo3bo3bobo$139bo26bo$139b3o16b3o$166bo$166bo4$87b3o$89bo$88b
o20$21b2o3b2o$21b2o2bob3o$25bo4bo$21b4ob2o2bo$21bo2bobobob2o$24bobobob
o$25b2obobo$29bo2$15b2o$3b3o10bo7b2o$2bo3bo3b3o3bobo5b2o$bo5bo2b3o4b2o
79bobo$98b2o$o7bobobo86bo$o7bobobo2$bo5bo2b3o$2bo3bo3b3o$3b3o21b2o17b
2o$27bo19b2o$28b3o15bo$16bo8bo4bo$10b2o4b2o5b3o24bo$9bo2bo2bobo4bo27b
3o$11b2o9b2o29bo$7bo44b2o$6bob2o52b2o$6bo5b2o48bo$5b2o5b2o46bobo$54b2o
4b2o$53bo2bo$54b2o$42b2o$42b2o$64bo$64b3o$18b3o37b2o7bo$10b2o4b2obo38b
obo5b2o$10b2o4b3o39bo3$15bobo33b2o3b2o$14bob2o13b2o19bo3bo$15bo15bobo
15b3o5b3o$16bo16bo15bo9bo16b2o$16b2o15b2o34b2o5bobo$18b2o49b2o7bo$18bo
b2o56b2o$14bo3bo2bo$15b2obobo44bo$17b3o44bobob2o$64bobobobo$63b2obobob
o2bo$64bo2b2ob4o$22bo41bo4bo$23bo41b3obo2b2o$21b3o43b2o3b2o!
Something similar can be arranged for an Fx119 edge shooter.

The loop length can be reduced either by adding two more p15N reflector bounces, or by replacing the two p15N reflectors in the main loop with Snarks (not sure which yet -- I'm still a bit out of practice, and short on time tonight).

On the other hand, maybe the right direction to go for a crab gun is to develop the universal shotgun toolkit a little more, and try it out here.

Sokwe
Moderator
Posts: 1480
Joined: July 9th, 2009, 2:44 pm

Re: How about a crab synthesis?

Post by Sokwe » December 29th, 2014, 12:33 am

I just want to point out this lesser-known p15 reflector:

Code: Select all

x = 19, y = 20, rule = B3/S23
8bo4bo$6b2ob4ob2o$8bo4bo8$9b2o6b2o$9b2o6b2o2$2o$2o2$15b2o$6b2o7bobo$7b
2o8bo$6bo10b2o!
I'm not sure if it's actually useful given all of the other p15 reflectors.

Edit: This p165 is smallish:

Code: Select all

x = 103, y = 76, rule = B3/S23
65bo2bob2obo2bo$65b4ob2ob4o$65bo2bob2obo2bo8$69b2o6b2o$69b2o6b2o2$60b
2o$60b2o2$75b2o$75bobo$21b2o3b2o49bo$21b2o2bob3o47b2o$25bo4bo$21b4ob2o
2bo$21bo2bobobob2o$24bobobobo$25b2obobo$29bo2$15b2o$3b3o10bo7b2o$2bo3b
o3b3o3bobo5b2o$bo5bo2b3o4b2o63bo$80bobo$o7bobobo68b2o$o7bobobo2$bo5bo
2b3o79b2o5b2o$2bo3bo3b3o79b2o5bo$3b3o21b2o17b2o49bobo$27bo19b2o48b2o$
28b3o15bo46b2o$16bo8bo4bo62bobo$10b2o4b2o5b3o24bo43bo$9bo2bo2bobo4bo
27b3o48bo$11b2o9b2o29bo47bo$7bo44b2o46b3o$6bob2o52b2o29b2o$6bo5b2o48bo
29bobo$5b2o5b2o46bobo29bo3bo3b3o$54b2o4b2o31b4o4bo$53bo2bo44bo$54b2o
45bo$42b2o49b4o4bo$42b2o48bo3bo3b3o$64bo27bobo$64b3o26b2o$18b3o37b2o7b
o32b3o$10b2o4b2obo38bobo5b2o33bo$10b2o4b3o39bo42bo3$15bobo33b2o3b2o$
14bob2o13b2o19bo3bo$15bo15bobo15b3o5b3o$16bo16bo15bo9bo16b2o$16b2o15b
2o34b2o5bobo$18b2o49b2o7bo$18bob2o56b2o$14bo3bo2bo$15b2obobo44bo$17b3o
44bobob2o$64bobobobo$63b2obobobo2bo$64bo2b2ob4o$22bo41bo4bo$23bo41b3ob
o2b2o$21b3o43b2o3b2o!
-Matthias Merzenich

User avatar
simsim314
Posts: 1702
Joined: February 10th, 2014, 1:27 pm

Re: How about a crab synthesis?

Post by simsim314 » December 29th, 2014, 1:35 am

Here is the script that uses the p165 (is this the smallest p165?):

Code: Select all

import golly as g 
import copy
import json 
import os 

def CellKeyFromXY(x, y):
	return str(x) + ":" + str(y)

def XYIterator():
	
	yield (0, 0)
	
	for i in xrange(-1, 2):
		for j in xrange(-1, 2):
			if i != 0 and j != 0:
				yield (i, j)

	
def GetDirection(t):
	dxx, dxy, dyx, dyy = t
	
	if dxy == 0:
		return dxx * dyy
	else:
		return dxy * dyx

def GetPositive(t):
	dxx, dxy, dyx, dyy = t
	
	return -(dxx + dxy)
	
def TrnasformDirection(direction, trans):

	dxx, dxy, dyx, dyy = trans 
	x, y = direction	
	
	return (dxx * x + dxy * y, dyx * x + dyy * y)
		
def TrnasformDirectionList(list, trans):
	return [TrnasformDirection(x, trans) for x in list]
	
def NewLogicalPatternRLE(rle, diff, inputs, outputs, period):
	result = LogicPattern()
	x, y = diff
	result.cells = g.parse(rle, x, y)
	result.inputs = inputs
	result.outputs = outputs
	result.period = period 
	
	return result
	
def NewLogicalPattern(cells, inputs, outputs, period, t):
	result = LogicPattern()
	result.cells = cells
	result.inputs = inputs
	result.outputs = outputs
	result.period = period 
	result.t = t 
	
	return result
	
class LogicPattern:
	
	def __init__(self):
		self.cells = []
		self.inputs = []
		self.outputs = []
		self.period = -1 
		self.t = ()

	def ToDict(self):
		return self.__dict__
		
	def FromDict(self, dict):
		for key in dict:
			self.__setattr__(key, dict[key])
		
		
	def GetListByOption(self, op):
		
		if op == "in":
			return self.inputs
		else:
			return self.outputs
	
	def Evolve(self, numIters):
		self.cells = g.evolve(self.cells, numIters)
			
class MovementData:
	def __init__(self, initX, initY, initPat):
		self.under = []
		self.curPat = []
		self.dx = -1
		self.dy = -1
		self.initX = initX 
		self.initY = initY
		self.initPat = initPat
		self.delta = 0 
		
	def RevertState(self):
		for i in xrange(0, len(self.curPat), 2):
			g.setcell(self.curPat[i] + self.dx, self.curPat[i + 1] + self.dy, 0)
		
		g.putcells(self.under)
		
	def UpdateState(self, newPat, dx, dy):
		self.under = []
		self.curPat = newPat
		self.dx = dx
		self.dy = dy
		
		for i in xrange(0, len(self.curPat), 2):
		
			if g.getcell(self.curPat[i] + self.dx, self.curPat[i + 1] + self.dy) == 1:
				self.under.append(self.curPat[i] + self.dx)
				self.under.append(self.curPat[i + 1] + self.dy)
				
			g.setcell(self.curPat[i] + self.dx, self.curPat[i + 1] + self.dy, 1)
		
		g.update()
	
	def UpdateCellDictionary(self, curdict, obejctIdx):
	
		for i in xrange(0, len(self.curPat), 2):
			x = self.curPat[i]
			y = self.curPat[i + 1]
			
			curdict[CellKeyFromXY(x + self.dx, y + self.dy)]  = obejctIdx

	def ClearCellDictionary(self, curdict, obejctIdx):
	
		before = len(curdict)
		removeList = [key for key in curdict if curdict[key] == obejctIdx]
		
		for key in removeList:
			x, y = key.split(":")
			g.setcell(int(x), int(y), 0)
			del curdict[key]
		
		after = len(curdict)
		g.show("size change: " + str(before)  + "," + str(after) + "," + str(obejctIdx))
		
class PlacementSnippet:
	id = 0 
	
	def __init__(self, attachedPatList, idx, moveData):
		self.moveData = moveData
		self.idx = idx 
		self.attachedPatList = attachedPatList
		self.id = PlacementSnippet.id 
		PlacementSnippet.id += 1
	
	def Update(self, attachedPatList, idx, moveData):
		self.moveData = moveData
		self.idx = idx 
		self.attachedPatList = attachedPatList

class LogicalDoc:
	def __init__(self, sigMan, recognizables):
		self.patterns = []
		self.snippets = [] 
		self.smarCells = {}
		self.sigMan = sigMan
		self.recognizables = recognizables

	def ToDict(self):
		dict = self.__dict__
		dict["sigMan"] = self.sigMan.ToDict()
		dict["recognizables"] = self.recognizables.ToDict()
		
		return str(dict)
	
	def FromDict(self):
		
		for key in dict:
			self.__setattr__(key, dict[key])
		
		self.sigMan = SignalManager()
		self.recognizables = LogicPatternCollection()
		
		self.sigMan.FromDict(dict["sigMan"])
		self.recognizables.FromDict(dict["recognizables"])
		
		return str(dict)
	
	def Save(self, file):

		with open(file, 'wb') as fp:
			json.dump(self.ToDict(), fp)
	
	
	def Load(self, file):

		with open(file, 'rb') as fp:
			data = json.load(fp)

		self.FromDict(data)
			
	def Main(self):
		
		g.show("left click on a pattern to change, 'h' for help")
		gollyMode = False
		
		while True:
		
			event = g.getevent()
			
			if ("key" in event and "return" in event) or (gollyMode and " a " in event):
				gollyMode = not gollyMode
				
				if gollyMode:
					g.show("In golly mode")
					g.update()

				else: 
					g.show("left click on a pattern, right click to finish")
					g.setrule("B3/S23")
					g.setalgo("HashLife")
					g.reset()
				
					g.update()
				
				continue 
				
			if gollyMode:
				
				if " delete " in event: 
					g.clear(0)
					
				if "click" in event and "ctrl" in event and g.getxy() != "":
					
					x, y = g.getxy().split()
					
					cell = g.getcell(int(x), int(y))
					
					if cell >= 0 and cell <= 1:
						g.setcell(int(x), int(y), 1 - cell)
					
					g.update()
				
				if " c " in event and "ctrl" in event and g.getselrect() != []:	
					g.copy()
				
				if " v " in event and "ctrl" in event and g.getxy() != "":
				
					x, y = g.getxy().split()
					
					g.paste(int(x), int(y), "or")
				
				if " space " in event:	
					if "ctrl" in event:
						g.run(10)
					else:
						g.run(1)
						
				g.doevent(event)
				continue 
				
			
			if "click" in event:
				
				if "left" in event:
					
					if self.ExistinCircuitHandler() == None:
						if self.SignalClickHandler(event) == None:
							g.show("left click on a pattern, h for help")
		
		
			elif "key" in event:
				if " space " in event:
					for i in xrange(0, 30):
						g.run(60)
						g.update()
						
					g.reset()
					g.update()		
					
				if " a " in event:
					
					if g.getrule() == "Perrier":
						g.setrule("B3/S23")
						g.setalgo("HashLife")
						g.update()
						
						
					else:
						g.setrule("Perrier")
						
						for key in self.smarCells:
							x, y = key.split(":")
							g.setcell(int(x), int(y),  self.smarCells[key] + 2)
						
						gollyMode = True
						g.show("In golly mode")
						g.update()
				
				if " s " in event:
					fname = os.path.join(g.getdir("data"), "MetadataManager.json")
					#self.Save(fname)
				
				if " h " in event:
					noteMessage = "Viewing and Selecting\n\n"
					noteMessage += "'left click' to chose gun or glider\n"
					noteMessage += "'a' to see in colors, a to go back \n"
					noteMessage += "'space' see ahead 1800 generations \n"
					noteMessage += "'enter' gollyMode, stays in the script \n"
					
					noteMessage += "\n Editing Gun \n\n"
					noteMessage += "'left click' to place\n"
					noteMessage += "'right click' to switch gun/orientation \n"
					noteMessage += "'delete' to delete the gun \n"
					noteMessage += "'left-right arrow' - one step adjustment\n"
					
					noteMessage += "\n In Golly Mode \n\n"
					noteMessage += "'delete' to clear selection\n"
					noteMessage += "'ctrl' + 'click' to draw \n"
					noteMessage += "'ctrl' + 'c' to copy selection \n"
					noteMessage += "'ctrl' + 'v' to paste in mouse location \n"
					noteMessage += "'space' + to run 1 generation \n"
					noteMessage += "'ctrl' +'space' to run 10 generations \n"
				
					g.note(noteMessage)
					
	def ExistinCircuitHandler(self):
		snip = self.ExitingSnippet()
		
		if snip == None:
			return None
		
		snip.moveData.ClearCellDictionary(self.smarCells, snip.id)
		self.ManageSnippet(snip)
		
	def ExitingSnippet(self):
	
		if g.getxy() == "":
			return None
			
		xs, ys = g.getxy().split()
		x = int(xs)
		y = int(ys)
					
		
		for i, j in XYIterator():
			key = CellKeyFromXY(x + i, y + j)
			if key in self.smarCells:
				return self.snippets[self.smarCells[key]]
	
		return None
		
	def SignalClickHandler(self, event):
		sigIn = sigMan.GetClickOnSignal(event)
		
		if sigIn != None:
			sig, op = sigIn
			pats = recognizables.GetPatternsBySignalClick((sig, op), sigMan)
			self.ManagePlacement(pats)
	
	def GetMovementData(self, attachedPatList, idx):
		
		return MovementData(attachedPatList[idx].x, attachedPatList[idx].y,	attachedPatList[idx].logicPat.cells)
			
	def ManagePlacement(self, attachedPatList):
		idx = 0
		movementData = self.GetMovementData(attachedPatList, idx)
		self.Placement(movementData, idx, attachedPatList, None)
		
	def ManageSnippet(self, snippet):

		self.Placement(snippet.moveData, snippet.idx, snippet.attachedPatList, snippet)
		
		
	def Placement(self, movementData, idx, attachedPatList, snip):
		
		while True:
		
			event = g.getevent()
			
			if event == "":
				self.ManageMove(attachedPatList[idx], movementData)
				
			elif "click" in event:
				
				if "right" in event: 
			
					movementData.RevertState()
					idx = (idx + 1) % len(attachedPatList)
					
					movementData = self.GetMovementData(attachedPatList, idx)
					self.ManageMove(attachedPatList[idx], movementData)
					
				elif "left" in event: 
					
					if snip == None:
						snip = PlacementSnippet(attachedPatList, idx, movementData)
						self.snippets.append(snip)
					else:
						snip.Update(attachedPatList, idx, movementData)
						
					movementData.UpdateCellDictionary(self.smarCells, snip.id)
					
					return 
				
			elif "key" in event:
				if "space" in event:
					for i in xrange(0, 30):
						g.run(60)
						g.update()
						
					g.reset()
					g.update()
				
				elif "right" in event:
					movementData.delta += 1
					
				elif "left" in event:
					movementData.delta -= 1
				
				elif "delete" in event: 
				
					movementData.RevertState()
					g.update()
					return 
			
				
	def ManageMove(self, attachedPat, movementData):
		
		val = g.getxy()
		
		if val == "":
			return 
		
		x1 = int(val.split()[0]) + movementData.delta
		self.MoveToX(attachedPat, x1, movementData)
		
		
	def MoveDelta(self, attachedPat, movementData, delta):
		movementData.RevertState()
		movementData.dx += delta * GetPositive(attachedPat.logicPat.t)
		self.MoveToX(attachedPat, movementData.dx, movementData)
		
	def MoveToX(self, attachedPat, x1, movementData):
		
		if  (x1 - movementData.initX) * GetPositive(attachedPat.logicPat.t)  < 0:
			x1 = movementData.initX
		
		y1 = movementData.initY + GetDirection(attachedPat.logicPat.t) * (x1 - movementData.initX)
		
		movementData.RevertState()
		movementData.UpdateState(g.evolve(movementData.initPat, 4 *  (x1 - movementData.initX) * GetPositive(attachedPat.logicPat.t)), x1, y1)
		
		
	def DrawAll(self):
		for pat in self.patterns:
			x, y = pat.location
			g.putcells(g.evolve(pat.attachedPat.logicPat.cells, pat.internal), x, y)

class AttachedLogicPat:
	def __init__(self, pat, i, option, x, y):
		self.logicPat = pat
		self.option = option 
		self.index = i
		self.x = x
		self.y = y 
	
	def ToDict(self):	
		dict = self.__dict__

		dict["logicPat"] = self.logicPat.ToDict()
		
	def FromDict(self, dict):	

		for key in dict:
			self.__setattr__(key, dict[key])
		
		self.logicPat = LogicPat()
		self.logicPat.FromDict(dict["logicPat"])
		 
	def Evolve(self, numIter):
		self.logicPat.Evolve(numIter)
		
	
class LogicPatternCollection:
	def __init__(self):
		self.patterns = []
		self.transList = []

		for i in xrange(-1, 2, 2):
			for j in xrange(-1, 2, 2):
				self.transList.append((i, 0, 0, j))
				self.transList.append((0, i, j, 0))

	
	def ToDict(self):
		dict = self.__dict__
		dict["patterns"] = [x.ToDict() for x in self.patterns]
		
		return dict 
		
	def FromDict(self, dict):
		for key in dict:
			self.__setattr__(key, dict[key])
		
		for i in xrange(0, len(self.patterns)):
			dict = self.patterns[i]
			self.patterns[i] = LogicPattern()
			self.patterns[i].FromDict(dict)
			
	def Add(self, logicPat):
		
		for t in self.transList:
			dxx, dxy, dyx, dyy = t 
			
			cells = g.transform(logicPat.cells,0, 0, dxx, dxy, dyx, dyy)
			
			if dxx == 0:
				cells = g.transform(g.evolve(cells, 2), -dxy, 0)
				
			inT = TrnasformDirectionList(logicPat.inputs, t)
			outT = TrnasformDirectionList(logicPat.outputs, t)
			p = logicPat.period
			pat = NewLogicalPattern(cells, inT, outT, p, t)
			
			self.patterns.append(pat)
	
	def FilterByDirection(self, dir, option):
		
		result = []
		
		for pat in self.patterns:

			filterList = pat.GetListByOption(option)
			
			for i in xrange(0, len(filterList)):
				if dir == filterList[i]:
					result.append(AttachedLogicPat(pat, i, option, 0, 0))
		
		return result 
				
	def  GetPatternsBySignalClick(self, sigClick, sigMan):
		physSig, option = sigClick
		cells, i, j, k, idx = sigMan.GetSignalFullData(physSig.signal)
		
		#bug fix not to evolve the setup data
		result = copy.deepcopy(self.FilterByDirection(TrnasformDirection((1, 1), (i, 0, 0, j)), option))

		for r in result:
			r.Evolve(k)
			r.x = physSig.x
			r.y = physSig.y
			
		return result
		
		
class PhysicalSignal:
	def __init__(self, sig, x, y):
		self.signal = sig
		self.x = x 
		self.y = y
		
	def Location(self):
		return (self.x, self.y)
		
class SignalManager:
	def __init__(self):
		self.signalsFullData = []
		self.signals = []
		
		self.components =  [g.parse("bo$2bo$3o!", -1, -1)]

		for idx in xrange(0, len(self.components)):
			comp = self.components[idx]
			
			for i in xrange(-1, 2, 2):
				for j in xrange(-1, 2, 2):
					for k in xrange(0, 4):
						self.signalsFullData.append((g.transform(g.evolve(comp, k), 0, 0, i, 0, 0, j), i, j, k, idx))
						self.signals.append(g.transform(g.evolve(comp, k), 0, 0, i, 0, 0, j))

						
	def ToDict(self):
		return self.__dict__
	
	def FromDict(self, dict):
		for key in dict:
			self.__setattr__(key, dict[key])
			
		
	def GetSignalFullData(self, sig):
		
		for i in xrange(0, len(self.signals)):
				if sig == self.signals[i]:
					return self.signalsFullData[i]
		
		return None
		
	def SignalAt(self, x, y):
		
		for s in self.signals:
			found = True
			
			for i in xrange(0, len(s), 2):
				xs = s[i]
				ys = s[i + 1]
				
				if g.getcell(x + xs, y + ys) == 0:
					found = False
					break
			
			
			if found:
				return s
				
		return None
		
	def SignalInArea(self, x, y):
	
		for i in xrange(x - 1, x + 2):
			for j in xrange(y - 1, y + 2):
				sig = self.SignalAt(i, j)
				
				if sig != None:
					return PhysicalSignal(sig, i, j)
					
		
		return None 
	
	def Remove(self, phisSig):
		
		for i in xrange(0, len(phisSig.signal), 2):
			xs = phisSig.signal[i]
			ys = phisSig.signal[i + 1] 
			
			g.setcell(phisSig.x + xs, phisSig.y + ys, 0)

	
	def GetClickOnSignal(self, event):
		
		xs, ys = g.getxy().split()
		x = int(xs)
		y = int(ys)
		
		sig = sigMan.SignalInArea(x, y)
		
		if sig != None:
			
			#sigMan.Remove(sig)
			
			if "left" in event:
				return (sig, "out")
			if "right" in event:
				return (sig, "out")

sigMan = SignalManager()
recognizables = LogicPatternCollection()

#rle_htog_1 = "31b2o$31b2obo$35bo8bo$32bo9b3o$33bob2o4bo$35b2o4b2o2$39bo13b2o$38bobo12b2o$39b2o2b2o$43b2o2$24bo$24b3o$27bo$26b2o3$15b2ob2o$15b2obo20b2o$18bo19bobo$18b3o4b2o11bo$16b2o3bo3b2o10b2o$15bo2b4o$15b2obo15b2o$16bo2b3o12bobo$16bo5bo13bo11b3o$17b5o14b2o10b3o$19bo28bo2bo6b2o$49b3o6bo$49b2o8b3o$32bobo26bo$33b2o$33bo4$91bo$92bo$48b2o40b3o$48b2o6$59b2o$38b2o19bo$39bo17bobo$39bobo15b2o$40b2o4bo6b2o$45bobo4bo2bo$45bobo5b2o$46bo10b2o$9bo47bobo$9b3o47bo$12bo46b2o5b2o$11b2o31b2o20bo$45bo22bo$42b3o3b2o14b5o$2ob2o37bo6bo13bo$2obo45bobo12b3o$3bo12bo33b2o15bo$3b3o4b2o2b2o48b4o$b2o3bo3b2o3b2o42b2o3bo3b2o$o2b4o52b2o4b3o2bo$2obo15b2o46bob2o$bo2b3o12bobo45bo$bo5bo13bo44b2o$2b5o14b2o$4bo$58b2o$58bo$45b2o12b3o$46b2o13bo$45bo2$34bo$32b3o$31bo$31b2o7$21b2o$20bobo5b2o$20bo7b2o$19b2o2$33bo$29b2obobo$28bobobobo$25bo2bobobob2o$25b4ob2o2bo$29bo4bo$25b2o2bob3o$25b2o3b2o!"
#rle_fx119 = "29$59b2o$60bo$60bobo$61b2o4$94bo$92b2o$60b2o$60b2o4b2o$66b2o4$65b2o$61b2o2b2o$60bobo16b3o$60bo12b2o4b3o$59b2o11bobo4bo2bo$72bo7b3o$71b2o7b2o7$122bo$123bo$121b3o6$81b2o$81b2o2$88bob2o$88b2obo3$70b2o$71bo$71bobo$72b2o2$38b2o5b2o$39bo5b2o39b2o$39bobo44bobo$40b2o46bo$44b2o42b2o$45bo4bo$43b2o3bobo$40bo8b2o$39b3o$38bob3o$37bo3bo$36bo3bo42b2o$35b3obo43bo$36b3o45b3o$37bo48bo8$73b2o$73b2o5$74bo$73b3o8b2o$63b2o7b2ob2o7bo$64bo6b2o2bo6bobo$64bobo4b2ob2o6b2o$65b2o5bo5bo$51bo23b2obo$50bo24b2o$50b3o22b2o5b2o$34bo47bobo$34b3o47bo$37bo46b2o$36b2o31b2o22b2o$70bo20bo2bo$67b3o3b2o14b5o$28b2o37bo6bo13bo$28bo45bobo12b3o$25b2obo46b2o15bo$25bo2b3o4b2o52b4o$26b2o3bo3b2o47b2o3bo3b2o$28b4o52b2o4b3o2bo$28bo15b2o46bob2o$29b3o12bobo45bo$32bo13bo44b2o$27b5o14b2o$26bo2bo$26b2o55b2o$83bo$84b3o$86bo3$59bo$57b3o$56bo$56b2o4$59b3o$61bo$60bo$46b2o$45bobo5b2o$45bo8bo$44b2o2$58bo$54b2obobo$53bobobobo$50bo2bo3bob2o$50b4ob2o2bo$54bo4bobo$52bobo5b2o$52b2o!"
#recognizables.Add(NewLogicalPatternRLE(rle_htog_1, (-91, -38), [], [(1, 1)], 160))
#recognizables.Add(NewLogicalPatternRLE(rle_fx119, (-122, -58), [], [(1, 1)], 160))

#p160
#rle_htog_1 = "31b2o$31b2obo$35bo8bo$32bo9b3o$33bob2o4bo$35b2o4b2o2$39bo13b2o$38bobo12b2o$39b2o2b2o$43b2o$54b2o$24bo15b2o11bo4bo$24b3o13bobo9bo5bo4b2o$27bo12bo11b2ob2obo3bo2bo$26b2o33b2obo4bo$55bo6bobo5bo$55bo7b3o2b3o$15b2ob2o34bo10bo$15b2obo20b2o11b2o$18bo19bobo13bo$18b3o4b2o11bo13b2o$16b2o3bo3b2o10b2o$15bo2b4o$15b2obo15b2o$16bo2b3o12bobo$16bo5bo13bo$17b5o14b2o$19bo38b2o$58bo$59b3o$61bo8$48b2o$38bo9b2o$36b2o$37b2o4$59b2o$38b2o19bo$39bo17bobo$39bobo15b2o$40b2o4bo$45bobo$45bobo$46bo10b2o$9bo47bobo$9b3o47bo$12bo41b2o3b2o5b2o$11b2o31b2o7b2o11bo$45bo9bo12bo$42b3o3b2o14b5o$2ob2o37bo6bo13bo$2obo45bobo12b3o$3bo46b2o15bo$3b3o4b2o52b4o$b2o3bo3b2o47b2o3bo3b2o$o2b4o52b2o4b3o2bo$2obo15b2o46bob2o$bo2b3o12bobo45bo$bo5bo13bo44b2o$2b5o14b2o$4bo$58b2o$58bo$59b3o$61bo3$34bo$32b3o$24bo6bo$25b2o4b2o$24b2o6$21b2o$20bobo5b2o$20bo7b2o$19b2o2$33bo$29b2obobo$28bobobobo$25bo2bobobob2o$25b4ob2o2bo$29bo4bo$25b2o2bob3o$25b2o3b2o!"
#rle_fx119 = "34b2o$35bo$35bobo22b2o$36b2o21bo4bo$58bo5bo4b2o$58b2ob2obo3bo2bo$48b4o15b2obo4bo$47b3ob2o8bo6bobo5bo$45bo3bo2b2o7bo7b3o2b3o$35b2o8bo2bo3bo7bo10bo$35b2o8bobo3bo6b2o$60bo$58b2o3$40b2o$36b2o2b2o$35bobo24b2o$35bo12b2o12b2o$34b2o11bobo$47bo$46b2o10$44bo$42b2o$43b2o3$56b2o$56b2o2$63bob2o$63b2obo3$45b2o$46bo$46bobo$47b2o2$13b2o5b2o31bo$14bo5b2o30b3o6b2o$14bobo34bo2bo6bobo$15b2o33b3o2b2o6bo$19b2o30bo2b3o6b2o$18bobo31b2o2b2o$19bo35b3o$15bo36b4obo$14b3o35b2o2b2o$13bob3o37b2o$12bo3bo$11bo3bo42b2o$10b3obo33bo9bo$11b3o33bo11b3o$12bo34b3o11bo8$48b2o$43bo4b2o$41bobo$42b2o4$59b2o$38b2o19bo$39bo17bobo$39bobo15b2o$40b2o4bo6b2o$45bobo4bo2bo$45bobo5b2o$46bo10b2o$9bo47bobo$9b3o47bo$12bo46b2o$11b2o31b2o22b2o$45bo20bo2bo$42b3o3b2o14b5o$3b2o37bo6bo13bo$3bo45bobo12b3o$2obo5b2o39b2o15bo$o2b2o6bo52b4o$b2o2bo2bob2o47b2o3bo3b2o$3bob2o52b2o4b3o2bo$3bobo13b2o31b3o12bob2o$4b3o12bobo32bo12bo$7bo6bo6bo31bo12b2o$2b5o8bo5b2o$bo2bo8b3o$b2o55b2o$58bo$59b3o$61bo3$34bo$32b3o$31bo$31b2o7$21b2o$20bobo5b2o$20bo7b2o$19b2o2$33bo$29b2obobo$28bobobobo$25bo2bobobob2o$25b4ob2o2bo$29bo4bobo$27bobo5b2o$27b2o!"
#recognizables.Add(NewLogicalPatternRLE(rle_htog_1, (-69, -16), [], [(1, 1)], 160))
#recognizables.Add(NewLogicalPatternRLE(rle_fx119, (-75, -7), [], [(1, 1)], 160))

#p165
sp165 = "28b2o6b2o$27bo2bo4bo2bo$27bo2bo4bo2bo$27bo2bo4bo2bo8bo$28b2o6b2o7b3o$44bo$44b2o$31bo2bo$29b3o2b3o5bo13b2o$28bo8bo3bobo12b2o$29b2o4b2o5b2o2b2o$30bo4bo10b2o$61b2o$27bo33b4o2b3o$27b3o10bobo13b2ob2o4bo3bo$30bo9b2o13bo2bo2b2o3bo$29b2o10bo13bo5b2o4bob2o$54bo14b2o$54b3o8bo2bo$18b2ob2o42b3o7bo$18b2obo20b2o32bo$21bo19bobo30b3o$21b3o4b2o11bo$19b2o3bo3b2o10b2o$18bo2b4o$18b2obo15b2o$19bo2b3o12bobo$19bo5bo13bo$20b5o14b2o$22bo38b2o$61bo$62b3o$64bo8$51b2o$51b2o3$38bo$36b2o$37b2o$62b2o$41b2o19bo$42bo17bobo$42bobo15b2o$43b2o4bo$48bobo$48bobo$49bo10b2o$55b2o3bobo$55bobo4bo$55bo6b2o$13b2o32b2o$13b2o33bo$45b3o$45bo25bo$3o50b2o14b5o$3o51bo13bo5bo$bo52bobo12b3o2bo$bo53b2o15bob2o$bo67b4o2bo$obo7b2o52b2o3bo3b2o$10b2o52b2o4b3o$72bo$obo69bob2o$bo69b2ob2o$bo$bo14b2o$3o13bo46b2o$3o7b2o5b3o43bo$10b2o7bo44b3o$66bo2$32bo$30bobo$31b2o9$35b2o9b2o4b2o$35b2o2b2o4bo2bo2bo2bo$39bobo3b2o6b2o$40bo4b2o6b2o$47b2o2b2o$37b2o$38bo$35b3o$35bo8bo2bob2obo2bo$43b2o2bo4bo2b2o$44bo2bob2obo2bo!"
recognizables.Add(NewLogicalPatternRLE(sp165, (-75, -20), [], [(1, 1)], 165))

doc = LogicalDoc(sigMan, recognizables)

#g.putcells(g.parse(rle_htog_1), -69, -16)
#fname = os.path.join(g.getdir("data"), "MetadataManager.json")

#if os.path.exists(fname):
#	doc.Load(fname)

#doc.Save(fname)

doc.Main()


Post Reply