Polynomial gun and cumulative sum generator

For discussion of specific patterns or specific families of patterns, both newly-discovered and well-known.
Post Reply
User avatar
gameoflifeboy
Posts: 474
Joined: January 15th, 2015, 2:08 am

Polynomial gun and cumulative sum generator

Post by gameoflifeboy » February 22nd, 2017, 2:26 am

I have constructed a device that takes in a stream of gliders, emitted (or at least passing by a given point) at generations x0, x1, x2, x3... and returns a stream of gliders at positions n, n + x0, n + x0 + x1, n + x0 + x1 + x2...

The values x0, x1... must be multiples of 960. Part of this is due to the fact that the glider duplicator is P30, but even if it is replaced with a stable mechanism, the values still need to be multiples of 64.

Here is the device inputted with 960*2, 960*3, 960*5, 960*6.

Code: Select all

#C Run to generation 15555
x = 4277, y = 4700, rule = LifeHistory
4273.3D$4272.D3.D$4272.D2.2D$4272.D.D.D$4272.2D2.D$4272.D3.D$4273.3D
474$3793.3D$3792.D3.D$3796.D$3795.D$3794.D$3793.D$3792.5D714$3072.5D$
3072.D$3072.D$3073.3D$3076.D$3072.D3.D$3073.3D1194$1874.D4.3D$1873.2D
3.D3.D$1872.D.D3.D2.2D$1874.D3.D.D.D$1874.D3.2D2.D$1874.D3.D3.D$1872.
5D2.3D1157$256.A.A$255.A2.A$256.A.A$272.2A$272.A.A$258.A13.3A$257.A.
2A11.A2.A$257.A.2A12.A$168.5A7.A75.A3.A12.A7.2A$166.2A5.2A4.A.A75.4A
20.2A$166.A7.A4.A77.3A15.A$166.2A7.A3.A2.A89.A$168.2A6.A3.3A89.A2.A$
171.A99.3A$171.A4.A13.2A79.3A$172.2A.A14.2A79.A2.A$272.A.A$268.A3.3A
11.2A$267.A.A15.2A.A$283.A4.A$261.2A15.2A8.A$261.2A15.A.A2.2A2.A$187.
A3.A6.2A67.A10.A.2A$185.A2.A.3A5.2A50.A14.2A.A.A4.6A$188.A.A.A55.2A.
2A13.A4.A2.A4.A$176.A.A7.A63.A15.A3.A3.A2.A$170.2A4.3A.A.2A.2A80.A2.A
4.2A$170.2A6.A2.2A3.A.A3.A74.3A$186.A.A62.2A$174.2A74.A2.A$162.3A8.4A
58.A7.A5.2A3.A$160.7A5.2A2.A57.3A5.A.A4.A4.A$159.9A3.A.3A57.2A.4A2.A
2.A3.A3.A$158.A7.3A3.2A.A58.3A2.A10.A2.A$159.3A6.A66.A2.2A2.A8.A$140.
3A6.A10.2A77.2A.A.A$139.A4.A3.A.A12.A79.A$139.A4.2A3.A14.A$139.A6.A
18.A$140.3A.A2.A.A97.2A$144.5A97.A2.A$149.A97.2A4$144.A94.A$143.A.A
92.4A6.2A$143.A.A91.A4.A4.3A.3A.2A$144.A91.2A10.2A.2A.A2.A$237.A.A.2A
4.3A.3A.2A$238.3A6.2A$239.A2$130.3A19.A78.A$130.A.A18.A.A73.2A.A.A7.A
$130.3A18.A.A73.A2.2A.2A2.2A.2A$152.A74.A5.A.A5.A$228.2A2.A8.A$132.2A
46.A51.A2.3A2.A$130.2A.2A46.2A49.3A$108.A21.2A2.2A44.2A23.A.A$106.2A.
2A18.2A3.2A69.A.A.A7.A$108.A21.2A2.2A68.A2.2A.A4.3A$123.2A6.A.A71.2A
3.A.A.2A.A$122.A2.A79.2A3.2A.5A10.3A$109.2A11.2A.2A82.A.2A3.2A10.A.A$
108.A2.A11.A84.A.A16.2A.2A$107.2A3.A10.3A101.2A$107.A4.A$107.A3.A$
108.A2.A118.A$109.A120.A2$125.A53.A44.3A$121.A3.A53.2A42.A3.A$122.A2.
A52.A.A41.A4.A$122.2A.2A85.2A.A5.A3.2A3.A$123.A.A82.A3.6A11.A$124.A
82.A5.A4.A2.2A6.3A$207.A11.A$112.2A94.A9.A$112.2A99.A$183.A29.A2.A$
183.A31.A$182.A.A$183.2A2.A11.2A$61.A120.A5.A9.A2.A13.2A$59.2A.2A118.
A5.A10.2A14.2A23.A$61.A58.2A60.A4.A12.A37.2A$76.2A42.2A25.A38.A13.A
38.2A$75.A2.A68.2A34.3A13.2A.A$62.2A11.2A.2A66.A.A49.2A$61.A2.A11.A
125.A$60.2A3.A10.3A102.2A.2A12.A.3A4.2A$60.A4.A19.2A99.A12.A2.A4.2A$
60.A3.A20.2A94.2A16.3A$61.A2.A118.3A$62.A2$78.A120.A$74.A3.A119.2A$
75.A2.A118.2A.A$75.2A.2A116.2A$72.A3.A.A10.3A103.2A21.A$72.A4.A11.2A.
A103.2A21.2A$92.2A21.A71.2A16.A$65.2A15.2A3.2A2.2A22.2A58.3A9.3A4.A$
65.2A14.2A.2A28.A.A58.A.A8.A4.A10.A$70.2A8.A4.A89.A.A9.2A2.2A4.2A4.A.
A$53.3A13.2A8.3A3.A89.A4.2A5.2A.A7.2A$53.A.A14.A2.3A2.A4.2A89.3A3.2A
15.A$53.3A14.2A2.2A2.A.A99.A$70.2A2.A4.2A72.A22.4A$29.3A39.3A77.2A.2A
21.2A$28.A26.2A15.A80.A23.A$27.A4.2A19.2A.2A110.2A$26.A3.A15.3A4.2A2.
2A108.A2.A7.A$26.A2.A4.A4.2A11.2A3.2A95.2A11.2A.2A4.A.A29.2A$26.A3.A
3.A4.3A.A9.2A2.2A94.A2.A11.A6.4A28.A.A$27.2A.A.3A19.A.A95.2A3.A10.3A
4.3A31.A$30.A121.A4.A19.A$31.4A48.A68.A3.A$33.2A11.A.2A33.2A68.A2.A$
46.A2.A32.A.A69.A$46.3A112.A$26.A12.A120.A.A7.A$25.3A10.A.A104.A14.A.
A3.A3.A$24.2A2.A9.A.A104.A7.A7.A5.A2.A$23.2A2.2A10.A105.A5.3A13.2A.2A
$24.2A118.2A3.A.A16.A.A$25.5A120.A2.A15.A$29.2A118.A2.2A$27.A2.A90.A
47.A$2.3A23.2A17.A73.A46.A.A$.A3.A40.A.A74.A5.A38.A.A$A3.2A40.A.A73.A
6.A.A37.A$.A45.A73.A3.A2.A$2.4A116.A2.A.A.2A$4.A.2A119.A.2A$4.A2.A
133.2A$5.2A12.2A120.2A$19.2A$151.A$141.A10.A$4.A17.2A115.A.A3.2A4.A$
4.A16.A2.A2.A110.A5.3A$3.A.A15.2A3.A112.A.3A3.A$4.A17.A3.A113.A5.A$4.
2A18.2A116.2A2.A$4.3A123.2A3.A8.A$128.3A4.2A$2.A4.2A114.3A.A8.2A$2.A
5.A118.A.A2.5A9.A$2.A5.A14.A104.A3.3A10.2A$7.A15.2A$19.2A2.2A117.A2.A
$19.2A121.A2.A$142.3A2$129.2A$7.2A4.2A.3A110.2A8.2A$7.2A3.2A.A3.A118.
3A$14.2A122.3A$15.A2.A120.A.A$14.A.2A121.A.A$14.3A122.3A$15.A113.2A$
129.A.A$15.2A112.A$15.2A$128.3D$127.D3.D$131.D$130.D$129.D$128.D$127.
5D72$376.A$377.A$375.3A6$402.A$401.A.A$400.A3.A$400.A3.A$400.A3.A$
400.A3.A$400.A3.A$400.A3.A$401.A.A21.2A$402.A16.2A4.2A$419.A$410.2A5.
A.A5.A$408.A2.A5.2A5.A.A$407.A16.A.A$407.A17.A$407.A$408.A2.A$410.2A
10.2A.A.2A$422.A5.A$423.A3.A$424.3A$434.D4.3D$433.2D3.D3.D$432.D.D3.D
$427.A6.D3.4D$427.A6.D3.D3.D$434.D3.D3.D$432.5D2.3D$417.2A8.A$418.2A
7.A$417.A8.A.A$425.2A.2A$424.A5.A$427.A$424.2A3.2A$410.A$398.2A10.2A$
391.3A4.2A9.A.A14.A$390.5A6.2A12.2A9.A$389.A.A3.A5.3A10.A3.A6.A$389.
2A3.A6.2A10.A5.A$398.2A13.A3.A2.A$398.2A13.A13.2A$414.A3.A3.A4.2A$
415.2A3.2A.A$423.A$423.2A104$369.2A$369.A.A$369.A2$368.3D$367.D3.D$
371.D$369.2D$371.D$367.D3.D$368.3D470$849.2A$849.A.A$849.A2$847.5D$
847.D$847.D$848.3D$851.D$847.D3.D$848.3D230$1089.2A$1089.A.A$1089.A2$
1088.3D$1087.D3.D$1087.D$1087.4D$1087.D3.D$1087.D3.D$1088.3D!
Starting with a gun as input, patterns can be constructed that emit gliders at time t = 960*p(n), where n is a non-negative integer and p is any polynomial such that
  • the values p(n) (but not necessarily the coefficients) are integers for integer values of n;
  • values of q0(n) = p(n+1) - p(n), q1(n) = q0(n+1) - q0(n), q2(n) = q1(n+1) - q1(n), etc. are all positive, unless q(n) = 0 for all values of n. (If p(n) is increasing, this must be true for p(n + a), for a sufficiently large value of a.)
Here is an example pattern, the cube gun. It emits a glider in the lower right corner at t = 960*n^3 + 493, for non-negative integer values of n.

Code: Select all

x = 2283, y = 1867, rule = B3/S23
258bobo$258bobobo7bo$173bo83bo2b2obo4b3o$172b3o83b2o3bobob2obo$171b3ob
o82b2o3b2ob5o$170bo3bo87bob2o3b2o$169b2o2bo2bo84bobo16b2o$168b3o2b4o
103b2o$170bo3bo2bo$170bo6bo$172bo2bo$174b2ob2o$174bo14b2o$189b2o$288b
2o$278bo2bo6b2o$173b2o90b2obo6b2obo2b2o$175bo85bo3b6o4b2obo4bo$173b2o
85bo5bo4bo3b2o$260bo11bo4bo4b2o$197b2o62bo9bo5b2ob2o$197b2o67bo$179bo
83bo2bo2bo$179b2o73bo8b2o3bo$171b3o4bob2o68b2obobo5b2obo$165b3o10bobo
69bo2b2ob2o2bo$164bo13b2o70bo5bobo4bo$164bo3bo82b2o2bo8bo$162b2o3b2o
86bo2b3o2bo$161bo2bobo2bo67bo17b3o$161bo2bobo2b2o65bobo$163b2ob2o2bo
64b2ob2o$164bo4bo65b2ob2o$167b2ob2o62b3o$143bo22b4o64b3o3bo$141b2ob2o
21b2o65b3o4bo$235b2o5bo$144b2o89b3o8b2o$145bo90b2o7bo2bo$139bo3bo93b2o
7b2o$143bo3bo2$237bo$141bo94b3o$142b3o90bo3bo$239b2o13b2o$238b2o13bo2b
o$142b3o109b2o$172bo60bo$142bo16b2o12bo58b3o$171b3o57b2ob2o$151bo78b2o
bobo$150bobo76b3o2b3o$135bo14bobo77bo6bo$131b4ob2o5b2o6bo79b5obo$130b
2ob3ob2o93b4ob2o$131bob3obo6bo64b3o25bo$132bo3b4o4b2o14b2o46bo2bo24bo$
135b2ob3o18b3o45bo4bo$136b5o18bo3bo43bo2b3o$112bo24bo20bo5bo42bo5bo$
108b2obobo7bo36bo5bo43b7o$108bo2b2ob2o2b2ob2o35bob2obo50bo$108bo5bobo
5bo10bo26bo53bo$109b2o2bo8bo9bobo23bo53b2o12b2o$113bo2b3o2bo35bob4o63b
2o$113b3o18b2o21b5o$131b3o25bo$211bo17bo$210bobo15bo2bobo$209b2obo14bo
2b5o$209b2o17bobo3bo15b3o$129bo80b3o16bo19b3o$128b3o80bo38b2o$127b3obo
80bo2bo34bo$126bo4bo77bo6bo$116bo2bo10bo78bo6bo$119b3o3b2o6bobo73bo4b
3o13bo21b3o$111b2o3b2ob4o10b2o94bo18bobo2b2o$111b2o9b2o10bo35b2o54b3ob
o16bob6o$169bobo54b2o18b2obo3bo$171bo75b2o3b2o$118bo133bo$220b3ob2o$
214b2o3b4o$180b3o31b2o3bo5bo$65bo53b2o59b3o14b2o24bobo$61b2obobo7bo44b
2o58bo3bo7bobo4b2o21b2obo$61bo2b2ob2o2b2ob2o104b2ob3o5bo2bo2b3o23b3o$
61bo5bobo5bo104b2o4bo4bobob6o19b2o2bo$62b2o2bo8bo107bo2bo9bo2b2o20bo2b
o$66bo2b3o2bo109b2o11b3o6b2o16bo$66b3o15b2o112bo7b2o13bo2bo$84b2o136b
2o2$138b2o$137bobo68bo$139bo66b2o2bo$206bo4bo$207b2o2bo2b2o$92b2o114bo
b2o2b2o$81bo3b2o5b2o112b4o$69bo2bo6b2ob2ob2o119b3o$72b3o3bo7bo99b2o13b
2o$64b2o3b2ob4o3bo6b2o98b2o13b2o$64b2o9b2o4b2o2b2o104bo$81b2o2b2o103bo
b2o4bo$174bo15bo2bo4bo2bo$67b3obo101bobo15bob2o5b2o$58bo9b2o102bo3bo
15b2o$54b4ob2o4b2obo103bo3bo13bobo$53b2ob3ob2o3b3o38b2o64bobob3o12bo$
54bob3obo44bobo49bo15b2obo2bo$34b3o6bo11bo3b4o4b2o38bo45b2obobo7bo10bo
bo$33bo4bo3bobo13b2ob3o89bo2b2ob2o2b2ob2o9b2o$33bo4b2o3bo15b5o89bo5bob
o5bo$33bo6bo19bo93b2o2bo8bo$34b3obo2bobo114bo2b3o2bo$38b5o115b3o$43bo
3$160bo$38bo120bobo$37bobo33b3o83bobo35bo4b2o$37bobo33b4o83bo35bo2bobo
2bo$38bo30b2o2b5o117b5o$68bo8b2o115bo4b3o$74b2ob3o66b3o49b2obo2bo$68bo
3bob2o2bo67bobo43bobo3b2o2b2o$68bo3bo3b2o68bobo19bo23bo6b3o$24b3o19bo
22b3o74bo4b2o14bobo22bo$24bobo18bobo97b3o3b2o14bobo$24b3o18bobo103bo
16bo$46bo77bo22b4o$124bo23b2o$26b2o95bobo22bo$24b2ob2o95b2o2bo11b2o$2b
o21b2o2b2o93bo5bo9bo2bo6bo$2ob2o18b2o3b2o93bo5bo10b2o5bobo$2bo21b2o2b
2o93bo4bo12bo4b4o$17b2o6bobo99bo13bo3b4o$16bo2bo104b3o13b2obo4bo$3b2o
11b2ob2o118b2o$2bo2bo11bo125bo$b2o3bo10b3o102b2ob2o12bob3o$bo4bo120bo
12bo2bo$bo3bo116b2o16b3o$2bo2bo118b3o$3bo2$19bo$15bo3bo118b2o$16bo2bo
121bo$16b2ob2o117bo2bo$17bobo119b2o$18bo120b2o$128b2o8bo2bo$6b2o120b2o
8bo$6b2o131b3o4$156bo$154bobo$136b2o8bo5b2o$14b2o120b2o7bobo4b2o12b2o$
14b2o128bo3bo3b2o12b2o$144b5o5bobo$143b2o3b2o6bo$144b5o$145b3o16b2o$
146bo17b2o4b3o$161b2o6b5o$160b3o5bo3bobo$153bo7b2o6bo3b2o$151b2ob2o8b
2o$123bo40b2o$123b2o25bo5bo$118b2o4b2o9b3o$118b2o4b3o23b2obob2o$118b2o
4b2o20b2o$123b2o21b2o$123bo42bo$165bobo$119bo44bo3b2o3b2o$118b3o43bo3b
2o3b2o$117bo3bo9bo32bo3b2o$116bob3obo7b3o32bobo$117b5o8b3o33bo2$128b2o
3b2o$128b2o3b2o3$131bo$130bobo$132b2o34bo2b2o$132b2o10bobo20bo3b2o2b2o
$131b3o9bo2bo4bo15bo7b2o$119b2o9bobo9b2o5b2o17b4o$119b2o9b2o8b2o3bo8b
2o$142b2o10b2o$136b2o5bo2bo$135bobo6bobo$135bo38bobo2bobo$134b2o17bo
16b2obo2bo2bo2bob2o$152bobo12bo6bobo2bobo$150b2o3bo10bobo$145b2o3b2o3b
o11b2o$145b2o3b2o3bo29b2o$152bobo30b2o$153bo6$161b3o$160bo3bo$159bo5bo
12b2o$159b2obob2o11b2o$179bo4b5o$183bob3obo$162bo21bo3bo$161bobo9b2o
10b3o$161bobo10b2o10bo$162bo10bo10b2o$183bobo$161b2o20bobo$161b2o21bo
2$166bo$166b2o13b2obob2o$154bobo8bobo13bo5bo$154bo3bo23bo3bo$144b2o12b
o10b2o12b3o$144b2o8bo4bo7bo2bo$158bo7bo7b5o$154bo3bo7bo6bo5bo$154bobo
9bo7b2o3bo$167bo2bo7bo$169b2o2$183b2o$183b2o655$1443b3o$1442bo$1441bo
4b2o$1440bo3bo15b3o$1440bo2bo4bo4b2o$1440bo3bo3bo4b3obo$1441b2obob3o$
1358b2o84bo$1361b2o4bo77b4o20b2o$1358b2ob4o3bo78b2o11bob2o5b2o$1355b5o
4b4o92bo2bo$1358b3o6bo92b3o$1359bo109bo$1358b3o108bo4bo$1365bo12b2o88b
obo2bobo$1365bo12b2o88bobobo3bo$1467bo4b3o2b2o$1472bobo3bo$1471b2o$
1469bo4b2obo$1449b2o13bo$1449b2o3b3o6bo$1386b2o49bo16bobo5bo2bo$1386b
2o48b2o16bo2bo4bo2bo$1376bo58b5o14b3o6b2o$1374b2obo47b2o7bo21bo$1360bo
b2obo9bob2o54b2o5bo14bo$1359bo4b3o10bo46bo3bo3b3ob2o16bobo$1360bo5bo
62bo3bobob2o2b2o11b2o$1361bo3bo56bo7bo3bo2bo2b2o13bo$1362bobo56bo4bo9b
2o$1331bo22bo67bobobo4bo6b2obo$1349bo2bobo2bo3bo60bo8bo9bo$1335bo13bo
4b2ob5o61bo4b2obo$1349bo3bo4bobo63bob2ob3o$1327b3obo93b3ob2o$1327b3obo
19b3o$1328bo8b2o13bo$1329bo3b3ob2o$1330bo6bo97b2o$1331bobobobo96bo2bo$
1332bo102b2o2$1070b3o$1070bo$1071bo260bo$1331bobo98b2o$1331bobo91bo5bo
2b2o7b2o$1332bo92bo4b3o2bo6bo2bo$1425bo4bo4bo7b2o$1430b5o$1431b2o$
1317b2o100bo$1316bo23bo77b2o7bo$1316bo2bo19bobo75bobob3o2bobo$1314b2ob
4o18bobo23bo50b3o3b2o3bo$1313bo26bo25b2o49bobob2obobo$1313bo3b3o2bo42b
2o51b2ob2o$1313bo2bo2bob3o95bob5obo$1295bo19b2o4b3o99b4o$1294b2o21b2ob
obo72b3o6bo$1293b5o20b2obo72bo4bo3bobo$1292bo19bo8bo72bo4b2o3bo$1291b
2o5bo13bo81bo6bo$1290b3ob2o8bobo5bo82b3obo2bobo$1291bobob2o2b2o3bobo
92b5o$1292bo2bo2b2o5bo98bo10b2o$1294b2o119b2o$1296b2obo$1299bo12b3o
102bo$1310b2o2bo101bobo$1311b3o102bobo4bo$1312bo104bo5b2o$1419b3o3bo$
1418b3o2b2o$1399b2o17bo$1364bo34b4o5bob2o7bo$1364b2o31b2ob3o5bo3bobo4b
2o$1363bobo31b2o3b2o10bo4b2o$1397b2obobo9bobo2bo2bo$1300b2o100bo5bobo
5bo4bo$1300b2o97b3o13b2ob2ob2o$1414bo5b2o$1418bo$1414bo16bo$1248bo121b
3o42bo3bo9b2o$1247b2o121bobo30b2o14bo10b2o$1246b5o119b3o30b2o13bo$
1245bo19bo42b2o76b2o26bo$1244b2o5bo13bo42b2o75bo2b2o24bo$1243b3ob2o8bo
bo5bo106b2o11b2ob2o24b2o$1244bobob2o2b2o3bobo110b2ob2o14bo$1245bo2bo2b
2o5bo73bo37b2o2b2o10b2o27b2o$1247b2o83b2o35b2o3b2o11bo7b2o15bob3o$
1249b2obo20b2o56bobo36b2o2b2o19b2o16bo2bo$1252bo12b3o5b2o96bobo39b3o$
1263b2o2bo$1264b3o$1265bo$1272b3o3bo108b3o$1272bob2ob3o104b3obo$1271b
2o3bo2b3o103b2ob2o10bo$1276bob2ob2o102b2ob2o9bobo$1278bo2b2o104bo11bo
2b2o$1275b2ob2o118b3o2bo$1375b2o14b4o6b3o$1253b2o4bo115b2o14b2ob3o$
1253b2o3bobo6b2o95bo14b3o7bo2bo2b2o$1240b2o15b2ob2o4b3o31bo62bobo13bo
4bo4b3o3bo$1239bo17b2o2bo4bo2bo30b2o60bo3bo16bobo2bo2bo2bo$1239bo2bo
15bob2o5b2o30bobo61bobo13bo2bo5bobo$1237b2ob4o14bobo79bo23bo19b2o3b2o$
1236bo22b2o78b2o39bo2bo40bo$1236bo3b3o2bo12bobo77b5o21b4o13b3o39bobo$
1236bo2bo2bob3o11bobo76bo19bo5bo4bo53bobo$1232bo5b2o4b3o11b2o76b2o5bo
13bo7bo56b2o$1218bobo6bo2b4o6b2obobo89b3ob2o8bobo5bo4bo3bo2bo$1217bo9b
ob4o8b2obo91bobob2o2b2o3bobo10bob3obo$1218bo2bo6b3o3b2o8bo92bo2bo2b2o
5bo12b3obo$1220b3o9bo2b2o102b2o$1233bob2o104b2obo48b2o$1234bo109bo12b
3o32bobo$1355b2o2bo34bo$1356b3o$1335b3o11bo7bo$1227bo41bo64bo2bo10bobo
$1226bobo38b2ob2o61bo4bo9bobo$1226bobo38b2ob2o61bo2b3o10bo$1214bo12bo
40bob2o61bo5bo$1213bobo51b2o65b7o$1212b2ob2o50b2o71bo$1212b2ob2o51b3o
42bo26bo$1211b3o52bo2bobo40b3o23b2o17bo$1211b3o3bo17bo29b2o2bobo39b2o
2bo40bobo$1211b3o4bo15bobo28b2o43b2o2b2o40bobo$1212b2o5bo14bobo74b2o
44bo$1190b3o19b3o20bo76b5o$1190bobo20b2o101b2o$1189bo3bo20b2o98bo2bo$
1189bo3bo121b2o12b2o$1189bo17b2o120b2o$1189bo4b2o11b2o4bo$1189bo6bo15b
obo$1190bo5bo14b4o117b2o$1190b2o18b2obo99b3o15bo$1192bo3bo13b2ob2o98bo
bo15b3ob3o$1193bobo10b2o3b2o100bo17b3o2bo$1207bo105bo2bo18bo$1206b3o
105bobo$1190b3o122b3o$1189bo3bo13bo109b2o$1190bo2bo14bo102b3o4b2o$
1192b2o13b2o108b2o14b2o$1207bo124bo$1329b2o2b2o$1204bo2bo121b2o$1206b
4o$1203bo$1204b2o2b2o117bo$1317b2o3b7o$1195b2o7b2o111b2o3bo4b2o$1195b
2o6b2o118bob2o$1204b2o2bo118bo$1324bo2bo$1324bo2bo$1324b3o$1325b2o$
1325b2o$1203b2o120b2o$1203b2o3$1333bo$1315b2o14b5o$1316bo13bo5bo$1316b
obo12b3o2bo$1317b2o15bob2o$1331b4o2bo$1326b2o3bo3b2o$1326b2o4b3o$1334b
o$1334bob2o$1333b2ob2o3$1325b2o$1325bo$1326b3o$1328bo12$1249bo$1248b3o
3$1248b3o2$1248bobo$1248bobo2$1248b3o$1272b2o$1266b2o4b2o$1248b3o15bo$
1249bo4bo9bobo$1253bobo8b2o$1251b2o3bo$1251b2o3bo$1251b2o3bo$1253bobo$
1254bo3$1269b2o3b2o$1271b3o$1270bo3bo$1271bobo$1272bo2$1266b3o4b3o$
1268bo4b3o$1267bo3$1271b2o3b2o$1272b5o$1259b2o12b3o$1258bobo13bo$1260b
o$1249bo$1248b4o$1247b2obobo6bobo$1236b2o8b3obo2bo3bo3bo$1236b2o9b2obo
bo4bo$1248b4o4bo4bo$1249bo7bo16b2o$1257bo3bo6b2o4b2o$1259bobo6bobo$
1270bo$1270b2o584$2144bo3bo$2143bobo3bo$2142bobo2b3o$2142b2o83$2253b3o
$2253b3o$2254bo$2254bo$2254bo$2253bobo3$2253bobo$2254bo$2254bo22b2o$
2254bo16b2o4b2o$2253b3o15bo$2253b3o3bo9bobo$2257b4o8b2o$2256bobob2o$
2255bo2bob3o$2256bobob2o$2257b4o$2259bo3$2275b5o$2274bob3obo$2275bo3bo
$2276b3o$2277bo$2272bo5b2o$2272b2o4bobo$2271bobo4bobo$2279bo3$2276b2ob
ob2o$2276bo5bo$2264b2o11bo3bo$2265b2o11b3o$2264bo$2253b2o$2252bo3bo$
2251bo5bo7bo$2241b2o8bo3bob2o4bobo$2241b2o8bo5bo3b2o$2252bo3bo4b2o$
2253b2o6b2o16b2o$2263bobo7b2o4b2o$2265bo7bobo$2275bo$2275b2o!
While patterns that emit gliders following a polynomial sequence have been constructed before, this is the first one I know of whose sequence degree can be adjusted to any positive integer value.

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

Re: Polynomial gun and cumulative sum generator

Post by calcyman » February 22nd, 2017, 2:35 am

Very impressive! Was this construction inspired by the Difference Engine?

https://en.wikipedia.org/wiki/Difference_engine
What do you do with ill crystallographers? Take them to the mono-clinic!

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

Re: Polynomial gun and cumulative sum generator

Post by gameoflifeboy » February 28th, 2017, 2:34 am

I just made a script that attempts to construct one for any polynomial, as long as the values, and all levels of their differences down to constant differences, are increasing:

Code: Select all

import golly as g
from fractions import Fraction

#maincomp = g.parse('261bo$173bo83b4ob2o5b3o$172b2o82b2ob3ob2o4b3o$171bob2o82bob3obo7b2o$\
#171bo2b2o82bo3b4o4b2o$169b4ob3o84b2ob3o$168bo2bobo2b2o84b5o13b2o$169bo\
#bobob3o85bo16b2o$170b2ob3obo$170b4o2bobo$173bo3bo$173bo3bo$173bo2bo12b\
#2o$189b2o$288b2o$276b3ob3o5b2o$268bo6b4obo2bo$174b2o89b2o4bo2bobo$260b\
#2o5b2o3bo10bo$260b2o7bob2o3b3o$197b2o78b2o2b2o$197b2o65bo$179b2o82bob\
#2o$178bo2bo69b5o6bo3bo$165b2o4b3o4bo2b2o66b2o5b2o3bo2b2o$177bo2b2o67bo\
#7bo3bobo$164bo3bo8b4o68b2o7bo5bo$169bo81b2o6bo$162bo7bo83bo$161bo4bo\
#69b3o15bo4bo$162bobobo4bo64b3o16b2obo$162bo8bo65bo$163bo4b2obo66b2o$\
#143bo20bob2ob3o67bo$142bobo20b3ob2o67bo2$142bo2bo$144b2o100b2o$145bo\
#90b2o7bo2bo$236b2o8b2o$237bo$237bo$236bobo$142b2o91bo$144bo91bo2b2o$\
#143b2o92bo3bo12b2o$142b3o94b2o12bo2bo$142b2o89bo5bo14b2o$232b3o$173bo\
#57b3obo$171bobo56bo3bo$151bo20b2o55b2o2bo2bo$133b3o14bobo75b3o2b4o$\
#131b7o12bobo77bo3bo2bo$130b9o12bo78bo6bo$129bo7b3o3b3o63b3o20bo2bo$\
#130b3o6bo68bo3bo21b2ob2o$131b2o11b2o15b2o44bo4bo21bo$134bo24bob2o43bo\
#3bo$135bo26b2o42bo2bob3o$109b5o7bo14bo26b2o41bo7bo$107b2o5b2o4bobo34b\
#2obob3o43bo3bobo$107bo7bo4bo38b4o45bo3bob2o$107b2o7bo3bo2bo35b3o48b3ob\
#2o$109b2o6bo3b3o8b2o27bo64b2o$112bo22bo21b2o67b2o$112bo4bo40bo$113b2ob\
#o14bo2bo$132bo77b2o$210b2o15b4o2b2o$211bo15bo2bobob2o$129bo97b2ob2obo\
#16bo$128b2o81bo17bo$127bob2o119bo$126b2o2bo$127b2obo78bo5b3o$126b3o80b\
#o7bo35bo$117bobo14bo74bo5bobo10b2o23b2o$111b2o4b3obobo8b2o81b2o10bo2bo\
#16bo3bo$111b2o6bo2b2o9b2o91bo3bo15b5o$228b2o15bo6bo$170b3o73b3o3b2o$\
#172bo49bo24bo4b2o$171bo48b2o$181bo32b2o2b2o5bo$180b3o15bo15b2o4b2o$\
#119b2o58b2ob2o14bo25bo$119b2o57b2o3bo7b4o3bo22b4o$62b5o7bo104bobobobo\
#5bo3bo24bobo$60b2o5b2o4bobo104b2obo2bo4b2o3bo22bo2b2obo$60bo7bo4bo109b\
#2obo7b3o23bo4bo$60b2o7bo3bo2bo107b2o10b2obo6b2o13bo$62b2o6bo3b3o120b3o\
#6b2o14bo2bo$65bo132bo23b2o$65bo4bo13b2o$66b2obo14b2o$206b2o$138b3o65bo\
#bo$140bo65bo3b3o$139bo66bobo3b4o$206bobo3b4o$205b3ob3o$81bo3bo6b2o112b\
#2o$79bo2bob3o5b2o92b2o13b2o$82bobobo99b2o13b2o$70bobo7bo110b3o$64b2o4b\
#3obob2ob2o109bob2o6bo$64b2o6bo2b2o3bobo3bo86b3o14bob2o5bobo$80bobo89bo\
#3bo22bobo$68b2o101bo4bo15bobo$56b3o8b4o100bo2bobo15b2o$54b7o5b2o2bo\
#100b2obobo15bo$53b9o3bob3o84b5o7bo6b2obo2bo$52bo7b3o3b2obo36b3o43b2o5b\
#2o4bobo7b2o2bo$34b2o17b3o6bo45bo43bo7bo4bo10b3o$35bo2bo4bo10b2o51bo44b\
#2o7bo3bo2bo$32bo2b3obo2bobo12bo96b2o6bo3b3o$32bo2bo4b4o14bo98bo$32bo2b\
#o23bo97bo4bo$35bo6bo115b2obo$34b2obo$42bo$40b2o118bo$159bobo$159bobo\
#39b3o$38bo121bo34bo4bo2bo$37bobo33bo120bo2bo3bo$37bobo32b2o3bo69bo46b\
#2obo2b2o$38bo33b2o4bo66b2ob2o44bo6bobo$72b2o4b2o68b2o43bo5bo3bo$73bobo\
#2b3o64b3o20bo23bo6b2ob2o$72bo5bo68bo3bo15bobo30bo$25bo44bob5o69bo3bo\
#16bobo$24b3o19bo25bo3bo70b3obo16bo$23b2ob2o17bobo21b3o52bo24b2o$24b3o\
#18bobo75bobo22bobo$25bo20bo75b2ob2o22bo$25bobo94b2o16b2o6b2o$25b4o99b\
#2o9bo2bo4b3o$2bo25bo93b3o2bo12bo2bo2b2ob2o$bobo122bob2o15bo2b3o$o3bo\
#19b2ob2o95bo2bo17b2o$bobo19bo5bo97bo11bo$2bo14b3o4bo3bo96b2o11b2o3bo$\
#16bo3bo4bo113bo3b2o$2b4o10b3o2bo103bo13bobob2o$bo4bo9bo3bo102b2ob2o11b\
#o3b2o$3bo13b3o106bo13b3o$o3bo2bo9b2o104bo16b3o$ob3obo118bo$b3obo2$139b\
#o$19bo118b3o$16b5o120bo$15bo122b2ob2o$137b2ob2o$16bo3bo107b2o7b2ob2o$\
#17b3o108b2o8bo2bo$139b3o$6b2o131b2o$6b2o4$136b2o$136b2o2$14b2o$14b2o!')

#maincomp = finalcomp + snark

maincomp = g.parse('261bo$173bo83b4ob2o5b3o$172b2o82b2ob3ob2o4b3o$171bob2o82bob3obo7b2o$\
171bo2b2o82bo3b4o4b2o$169b4ob3o84b2ob3o$168bo2bobo2b2o84b5o13b2o$169bo\
bobob3o85bo16b2o$170b2ob3obo$170b4o2bobo$173bo3bo$173bo3bo$173bo2bo12b\
2o$189b2o$288b2o$276b3ob3o5b2o$268bo6b4obo2bo$174b2o89b2o4bo2bobo$260b\
2o5b2o3bo10bo$260b2o7bob2o3b3o$197b2o78b2o2b2o$197b2o65bo$179b2o82bob\
2o$178bo2bo69b5o6bo3bo$165b2o4b3o4bo2b2o66b2o5b2o3bo2b2o$177bo2b2o67bo\
7bo3bobo$164bo3bo8b4o68b2o7bo5bo$169bo81b2o6bo$162bo7bo83bo$161bo4bo\
69b3o15bo4bo$162bobobo4bo64b3o16b2obo$162bo8bo65bo$163bo4b2obo66b2o$\
143bo20bob2ob3o67bo$142bobo20b3ob2o67bo2$142bo2bo$144b2o100b2o$145bo\
90b2o7bo2bo$236b2o8b2o$237bo$237bo$236bobo$142b2o91bo$144bo91bo2b2o$\
143b2o92bo3bo12b2o$142b3o94b2o12bo2bo$142b2o89bo5bo14b2o$232b3o$173bo\
57b3obo$171bobo56bo3bo$151bo20b2o55b2o2bo2bo$133b3o14bobo75b3o2b4o$\
131b7o12bobo77bo3bo2bo$130b9o12bo78bo6bo$129bo7b3o3b3o63b3o20bo2bo$\
130b3o6bo68bo3bo21b2ob2o$131b2o11b2o15b2o44bo4bo21bo$134bo24bob2o43bo\
3bo$135bo26b2o42bo2bob3o$109b5o7bo14bo26b2o41bo7bo$107b2o5b2o4bobo34b\
2obob3o43bo3bobo$107bo7bo4bo38b4o45bo3bob2o$107b2o7bo3bo2bo35b3o48b3ob\
2o$109b2o6bo3b3o8b2o27bo64b2o$112bo22bo21b2o67b2o$112bo4bo40bo$113b2ob\
o14bo2bo$132bo77b2o$210b2o15b4o2b2o$211bo15bo2bobob2o$129bo97b2ob2obo\
16bo$128b2o81bo17bo$127bob2o119bo$126b2o2bo$127b2obo78bo5b3o$126b3o80b\
o7bo35bo$117bobo14bo74bo5bobo10b2o23b2o$111b2o4b3obobo8b2o81b2o10bo2bo\
16bo3bo$111b2o6bo2b2o9b2o91bo3bo15b5o$228b2o15bo6bo$170b3o73b3o3b2o$\
172bo49bo24bo4b2o$171bo48b2o$181bo32b2o2b2o5bo$180b3o15bo15b2o4b2o$\
119b2o58b2ob2o14bo25bo$119b2o57b2o3bo7b4o3bo22b4o$62b5o7bo104bobobobo\
5bo3bo24bobo$60b2o5b2o4bobo104b2obo2bo4b2o3bo22bo2b2obo$60bo7bo4bo109b\
2obo7b3o23bo4bo$60b2o7bo3bo2bo107b2o10b2obo6b2o13bo$62b2o6bo3b3o120b3o\
6b2o14bo2bo$65bo132bo23b2o$65bo4bo13b2o$66b2obo14b2o$206b2o$138b3o65bo\
bo$140bo65bo3b3o$139bo66bobo3b4o$206bobo3b4o$205b3ob3o$81bo3bo6b2o112b\
2o$79bo2bob3o5b2o92b2o13b2o$82bobobo99b2o13b2o$70bobo7bo110b3o$64b2o4b\
3obob2ob2o109bob2o6bo$64b2o6bo2b2o3bobo3bo86b3o14bob2o5bobo$80bobo89bo\
3bo22bobo$68b2o101bo4bo15bobo$56b3o8b4o100bo2bobo15b2o$54b7o5b2o2bo\
100b2obobo15bo$53b9o3bob3o84b5o7bo6b2obo2bo$52bo7b3o3b2obo36b3o43b2o5b\
2o4bobo7b2o2bo$34b2o17b3o6bo45bo43bo7bo4bo10b3o$35bo2bo4bo10b2o51bo44b\
2o7bo3bo2bo$32bo2b3obo2bobo12bo96b2o6bo3b3o$32bo2bo4b4o14bo98bo$32bo2b\
o23bo97bo4bo$35bo6bo115b2obo$34b2obo$42bo$40b2o118bo$159bobo$159bobo\
39b3o$38bo121bo34bo4bo2bo$37bobo33bo120bo2bo3bo$37bobo32b2o3bo69bo46b\
2obo2b2o$38bo33b2o4bo66b2ob2o44bo6bobo$72b2o4b2o68b2o43bo5bo3bo$73bobo\
2b3o64b3o20bo23bo6b2ob2o$72bo5bo68bo3bo15bobo30bo$25bo44bob5o69bo3bo\
16bobo$24b3o19bo25bo3bo70b3obo16bo$23b2ob2o17bobo21b3o52bo24b2o$24b3o\
18bobo75bobo22bobo$25bo20bo75b2ob2o22bo$25bobo94b2o16b2o6b2o$25b4o99b\
2o9bo2bo4b3o$2bo25bo93b3o2bo12bo2bo2b2ob2o$bobo122bob2o15bo2b3o$o3bo\
19b2ob2o95bo2bo17b2o$bobo19bo5bo97bo11bo$2bo14b3o4bo3bo96b2o11b2o3bo$\
16bo3bo4bo113bo3b2o$2b4o10b3o2bo103bo13bobob2o$bo4bo9bo3bo102b2ob2o11b\
o3b2o$3bo13b3o106bo13b3o$o3bo2bo9b2o104bo16b3o$ob3obo118bo$b3obo2$139b\
o$19bo118b3o$16b5o120bo$15bo122b2ob2o$137b2ob2o$16bo3bo107b2o7b2ob2o$\
17b3o108b2o8bo2bo$139b3o$6b2o131b2o$6b2o4$136b2o$136b2o2$14b2o$14b2o!')

snark = g.parse('18bo$2o14b5o$bo13bo5bo$bobo12b3o2bo$2b2o15bob2o$16b4o2bo$11b2o3bo3b2o$\
11b2o4b3o$19bo$19bob2o$18b2ob2o3$10b2o$10bo$11b3o$13bo!', 389, 78)

finalslider = g.parse('bo$2bo$3o19$43bo$42bobo3$42b3o$42b3o$43bo3$43bo$42b3o$42b3o21b2o$60b2o\
4b2o$60bo$42bobo7b2o3b2obo$43bo7bo3bo3bo$50bo14b3o$50bo3bo2bo7b3o$50bo\
5bo7bo3bo$51bo3bo7bo5bo$52b2o10bo3bo$65b3o5$67b2obo$68b2o5$57b2o$58b2o\
8bo$57bo9b3o$66b5o$65bobobobo$65b2o3b2o2$39bo10bo$39b2o9b2o16bo$34b2o\
4b2o7bobo4bo10bobo$30b2o2b2o4b3o13bobo8bobo$30b2o2b2o4b2o15bobo8bo$39b\
2o16bo2bo7b2o$39bo17bobo8b2o$56bobo3b2o4b2o$56bo5bobo$64bo$64b2o!', 246, 118)

slider = finalslider + snark

glider = g.parse('bo$2o$obo!', 119, 157)

def process(polyn):
	termlist1 = polyn.split('+')
	termlist2 = []
	for terms in termlist1:
		splitterms = terms.split('-')
		signedsplitterms = splitterms[:1]
		for term in splitterms[1:]:
			signedsplitterms.append('-' + term)
		termlist2.extend(signedsplitterms)
	parsedterms = []
	for term in termlist2:
		if 'x' in term:
			if term[0] == 'x':
				term = '1' + term
			if term[:2] == '-x':
				term = '-1' + term.strip('-')
			if 'x^' in term:
				coef_exp = term.split('x^')
				parsedterms.append((Fraction(coef_exp[0]), int(coef_exp[1])))
			else:
				parsedterms.append((Fraction(term.split('x')[0]), 1))
		else:
			parsedterms.append((Fraction(term), 0))
	maxexp = 0
	for termtup in parsedterms:
		if termtup[1] > maxexp:
			maxexp = termtup[1]
	processed = [0] * (maxexp + 1)
	for termtup in parsedterms:
		processed[termtup[1]] += termtup[0]
	return processed

def firstvalues(terms):
	vals = []
	for x in xrange(len(terms)):
		sum = 0
		for exp, coef in enumerate(terms):
			sum += coef * x ** exp
		if sum != int(sum):
			g.warn("Polynomial must produce integer values when x is an integer.")
			g.exit()
			return
		vals.append(int(sum))
	return vals

# Returns a list containing the first term of the polynomial,
# the difference between the first two terms,
# the difference between the first two differences,
# the difference between the first two differences of differences, etc.
# I call these terms the starter constants of a sequence of numbers.
# For more information about these values in relation to x^n sequences, see:
# http://mathandnumberystuff.tumblr.com/tagged/starter-constants
def firstdiffs(values):
	if len(values) < 1:
		g.warn("No polynomial entered, apparently.")
		g.exit()
		return # Just for good measure.
	if len(values) == 1:
		return [values[0]]
	if len(values) > 1:
		diffs = []
		for n in xrange(len(values) - 1):
			diffs.append(values[n + 1] - values[n])
		return firstdiffs(diffs) + [values[0]]

def getvaluefromdiffs(startconsts, n):
	if n + 1 < len(startconsts):
		return getvaluefromdiffs(startconsts[len(startconsts) - n + 1:], n)
	currconsts = [0] * (n - len(startconsts) + 1)
	for sc in startconsts:
		nextconsts = [sc]
		for num, val in enumerate(currconsts):
			nextconsts.append(nextconsts[num] + val)
		currconsts = nextconsts
	return currconsts[n]

polyn = g.getstring("Enter your polynomial (like 1/10x^5+9/10x):")
terms = process(polyn)
values = firstvalues(terms)
startconsts = firstdiffs(values)
for diff in startconsts[:-1]:
	if diff <= 0:
		g.warn("One set of differences in this polynomial is not strictly increasing.")
		g.exit()
offset = startconsts[-1]
sc = startconsts[:-1]

g.new('%s gun' % polyn)
if sc[0] == 1:
	gun = g.parse('bo$2o$obo13$4b2o$2o2b2o$2o2bob2o13bo2bob2obo2bo$5b3o13b4ob2ob4o$21bo2b\
	ob2obo2bo2$5b2o$5b2o31bo24b2o$38b2o23bo$33b2o4b2o13b2o5bobo$29b2o2b2o\
	4b3o11b3o5b2o$29b2o2b2o4b2o9bob2o$38b2o10bo2bo$38bo11bob2o$9b5o28bo10b\
	3o$8bob3obo27bobo9b2o6b2o$9bo3bo28b2o18b2o$10b3o$11bo2$8b2o$9bo$6b3o\
	21b2o$6bo10bo12b2o$15b3o7b2o$14bo9b4o8bo25b3o$14b2o7b2o10b4o22bo3bo$\
	22b2o11bob3o20bo5bo$23bobo13b2o19bo5bo$25bobo10bo24bo$25b3o33bo3bo$26b\
	o35b3o$9b2obob2o9bo37bo$9bo5bo30b3o9b2o$10bo3bo31bo9bo2bo$11b3o27bo5bo\
	7bo7b2o$39b4o12bo6bo2bo$33b2o3bobob2o11bo7b2o$33b2o2bo2bob3o11bo2bo$6b\
	2o30bobob2o14b2o$6bo2bo29b4o$41bo2$6bob2o$b2o2bobo$bo4bo$5bo$2bo2bo!', 119, 157)
	g.putcells(gun)
else:
	gun = g.parse('30b2o$29bobo$28bo6b2o$28bo2bo2bo2bob2o$28bo6b2o2b2o$18b3o8bobo$30b2o$\
	18bobo$17b5o$16b2o3b2o$16b2o3b2o2$30bo$30bobo$33b2o4b2o$33b2o4b2o$33b\
	2o$30bobo$30bo2$17b2o$17b2o6$11b2o$9bo2bo$8bo7b5o$2o6bo6bo5bo$2o6bo7b\
	2o3bo$9bo2bo7bo11b2o$11b2o19bobo10b2o2b2ob2o3b2ob2obo$22b2o8bo12bo2bob\
	obobobobobob2o$18bobo2bo22bobobobobobo3bo$16b3ob2o23b2obob3obob5o6bo\
	11b2o$15bo33b5o12bobo10b2o$16b3ob2o36bo3b2o2bobo$18bob2o35bobo2bo2b2ob\
	2o$57bobo3bobo$50b3o5bob4o2bob2o$51bo8bo3bobob2o$51bo7bo3bobo$58bo3bob\
	o$13b2o43b2o3bo$14bo22b2o$14bobo20bo$15b2o18bobo$35b2o34b2o$71b2o$86b\
	2o$22b3ob4o55bo2bo$21bo2b3o2bo56b2obo$20bo4bo63bo$21bobo2b3o60b2o$23bo\
	b2o47b2o$23b3o49bo$24bo21b2o24b3o$46b2o11b2o11bo$39bo19bo$23b2o15b2o\
	18b3o$19b2o2b2o14b2o21bo$18bobo$18bo$17b2o!', 129, 160) + g.parse('42bo$42b2o$41b2obo$40bo2b3o$39bobobo$38bobobo$36b3o2bo$37bob2o$38b2o$\
	35bo3bo$34bobo$34b2o$38b2o$38bobo$33b2o5bo$33b2o5b2o17$17b2o$17bo$15bo\
	bo$15b2o2$2o$2o2$9b2o$9b2o6b2o$17b2o3$5bo$4bobo$4b2o6b2o$12bo$13b3o$\
	15bo!', 187 + 30*(sc[0] - 2), 213 + 30*(sc[0] - 2))
	gun = g.evolve(gun, 180)
	g.putcells(gun)

usedconsts = [sc[0]]
mainx, mainy = 0, 0
for n, diff in enumerate(sc[1:]):
	if n == len(sc) - 2:
		usedslider = finalslider
	else:
		usedslider = slider
	usedconsts.append(diff)
	repos = diff - 1
	newslider = g.evolve(usedslider, 480*repos)
	g.putcells(maincomp, mainx, mainy)
	ahead = 0
	maketime = 1440*diff - 960
	hittime = 480
	_ = hittime - maketime
	num = 0
	vals = [diff]
	while num <= len(sc) + 1 or _ < 0:
		num += 1
		vals.append(getvaluefromdiffs(usedconsts, num))
		if hittime - maketime < 0:
			ahead += maketime - hittime
			g.run(maketime - hittime)
		maketime = 1440*vals[num] - 1440*diff + 480
		hittime = 960*sum(vals) - 480*vals[num] - 480*diff + 480 + ahead
		_ = hittime - ahead - maketime
	g.putcells(newslider, mainx + 120*repos, mainy + 120*repos)
	mainx += 64
	mainy += -293
	if n != len(sc) - 2:
		g.run(1440)
	g.fit()
calcyman wrote:Very impressive! Was this construction inspired by the Difference Engine?

https://en.wikipedia.org/wiki/Difference_engine
No, but it does seem similar. Before I made it, I was looking for a way for a gun to shoot a particular polynomial sequence, but constructing it from the polynomial term by term seemed too hard. So I used my years of experience constructing sequences from their differences to make a pattern that did the same thing.

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

Re: Polynomial gun and cumulative sum generator

Post by gameoflifeboy » February 28th, 2017, 11:57 pm

I just updated my script to clear the canvas before placing the pattern.

Post Reply