Python script ideas needed

For scripts to aid with computation or simulation in cellular automata.
Post Reply
User avatar
Saka
Posts: 3413
Joined: June 19th, 2015, 8:50 pm
Location: In the kingdom of Sultan Hamengkubuwono X
Contact:

Python script ideas needed

Post by Saka » November 27th, 2016, 12:16 am

I'm bored and my current Python script has one major glitch I can't seem to fix so I need some ideas for python scripts to make. Criteria:
-Must be simple
-NOT a spaceship search program
-Is doable
-Does not require the separation of objects (I don't know how to do this yet)
-Does not require the detection of stabilizing in rules with gliders (the gliders get in the way)
-Must be suitable for an amateur programmer

Code: Select all

o3b2ob2obo3b2o2b2o$bo3b2obob3o3bo2bo$2bo2b3o5b3ob4o$3o3bo2bo2b3o3b3o$
4bo4bobo4bo$2o2b2o2b4obo2bo3bo$2ob4o3bo2bo2bo2bo$b2o3bobob2o$3bobobo5b
obobobo$3bobobob2o3bo2bobo!
(Check gen 3)
Add your computer to the Table of Lifeenthusiast Computers!

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

Re: Python script ideas needed

Post by dvgrn » November 27th, 2016, 10:10 am

Saka wrote:I'm bored and my current Python script has one major glitch I can't seem to fix so I need some ideas for python scripts to make...
Would you consider branching out into Lua? There are all kinds of things to be tried with the Golly 2.9 beta's new overlay functionality. Check out the new buttons, checkboxes and sliders in pop-plot.lua, for example. Some more controls will need to be invented, but eventually it should be possible to make better GUI front ends for various search utilities.

Maybe that's a bit ambitious for just starting out with Lua, but check out overlay-demo.lua -- see if any of the samples give you ideas for things to experiment with.

Seems to me we probably need to add a button in overlay-demo.lua to show how to use the "cellview" options to create animations of actual patterns, as opposed to the completely non-pattern-related animations we have so far. Oddly enough, there's not a single "cellview" in the current overlay-demo.lua; even the glider in the "Animation" demo is animated frame by frame with no use of Golly's simulation abilities (!). Here's a sample use of cellview that I put together yesterday.

If you want to stick with Python, I've been thinking that there should be a few more tools that ship with Golly, to do things like change cell states in some organized way. I have one named "ToChangeColors.py", that expects you to pick a drawing color, then click on a cell in the current selection, and it will change all the cells of the clicked color to the current drawing color. That lets you get rid of all blue history cells in LifeHistory by changing them to state 0, for example, or mark all state-1 cells in a selection by changing them to state 3 or state 4.

What other tools along those lines would be useful to have as part of Golly's standard toolkit? Think of something that you wish Golly had available, and then implement it.

Alternatively, maybe code something from your list in Python? A nice simple Python and/or Lua function can be written for a lot of those -- and then they might get included in the glife or gplus packages in some cases. It's unlikely that they'd be added to the list of native Golly script functions, unless the function has to do something that Python and Lua really can't do without a change to Golly's codebase.

User avatar
Saka
Posts: 3413
Joined: June 19th, 2015, 8:50 pm
Location: In the kingdom of Sultan Hamengkubuwono X
Contact:

Re: Python script ideas needed

Post by Saka » November 27th, 2016, 10:14 am

Yes! I will make a "LifePlus" module that does the things I suggest! Awesome! Tomorrow!

Code: Select all

o3b2ob2obo3b2o2b2o$bo3b2obob3o3bo2bo$2bo2b3o5b3ob4o$3o3bo2bo2b3o3b3o$
4bo4bobo4bo$2o2b2o2b4obo2bo3bo$2ob4o3bo2bo2bo2bo$b2o3bobob2o$3bobobo5b
obobobo$3bobobob2o3bo2bobo!
(Check gen 3)
Add your computer to the Table of Lifeenthusiast Computers!

User avatar
rowett
Moderator
Posts: 2022
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Python script ideas needed

Post by rowett » December 16th, 2016, 10:22 am

dvgrn wrote:Seems to me we probably need to add a button in overlay-demo.lua to show how to use the "cellview" options to create animations of actual patterns
We do now!

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

Re: Python script ideas needed

Post by Rhombic » December 17th, 2016, 8:44 am

From Script request thread, admitting that I'm absolutely useless with both Python and C

Script that calculates a number of gliders to be fired at a selected pattern to yield a non-zero number of spaceships, no static ash (so 0 still lifes, 0 oscillators... only spaceships)

If possible, it would be great if the script allowed non-CGoL rules with gliders to be explored too.
SoL : FreeElectronics : DeadlyEnemies : 6a-ite : Rule X3VI
what is “sesame oil”?

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

Re: Python script ideas needed

Post by dvgrn » December 18th, 2016, 11:21 am

Rhombic wrote:Script that calculates a number of gliders to be fired at a selected pattern to yield a non-zero number of spaceships, no static ash (so 0 still lifes, 0 oscillators... only spaceships)
I've put my oar in about this request before, but here's another attempt:

If the request is "find the minimum number of gliders..." then it's technically possible to write such a script, but for most target objects you might run it for years/decades/centuries before getting a definite answer.

If the request is "find a not necessarily minimal number of gliders..." then such a program has already been written, several times, most recently as a compiled C utility (simeks' GoL_destroy) (but that adds more objects to the pattern in question). There was another recent project that tried all possible single gliders on a pattern, and chose the result that reduced the population the most. I'll find the link eventually, if no one else does...

EDIT: Here it is.

If the request is somewhere between those two, such that GoL_destroy and Andrew Wade's Gemini-destroying search script are not good enough, then please be more specific. Presumably you want to exclude the following two cases:

1) Find gliders that destroy the pattern completely, then add another glider that doesn't interact with the destruction at all;
2) Find gliders that destroy the pattern almost completely but leave a glider turner (like a boat) or a spaceship seed of your choice -- then fire a final glider at the turner or seed.

Post Reply