Device Specific Scripting

For scripts to aid with computation or simulation in cellular automata.
Post Reply
User avatar
otismo
Posts: 1212
Joined: August 18th, 2010, 1:41 pm
Location: Florida
Contact:

Device Specific Scripting

Post by otismo » October 24th, 2020, 10:07 am

Golly Python Script

seems to be a very high-level code

almost pseudocode

after studying a few scripts,

it seems that there are connected .DLLs .LIBs etc.

PM2Ring's script that makes a BitMap Printer,

calls for a "dot matrix printer"

and there is only a bit of .rle pattern code in the whole script.

SO a lot of necessary code is elsewhere.

Is there a tutorial that would get me up to speed on this ?

I have just crafted a huge pattern, and I do not want to "sculpt" the code into ROM ( deleting gliders ).

What I need is a simple looping script that loops between two arrays which have one-for-one correspondence.

One array has all the ROM glider locations, the other has the "on" pixels from the bitmap selection ( glider present ).

At least, this is how I would go about coding it. But I notice that PM2Ring's script has no arrays at all, indicative of higher level

language. I appreciate any help I may get with this, it would be better than "winging it". But I want to see my creation in action - - - - -

that is only normal - Thank You ! ! !

folks at conwaylife.com are TOPS !

attd is the pattern I want script for :
P420-Loafer-BitMap-Printer-80bit-EMPTY-ROM-with-PASTE-LOAFER-INLINE-MIRRORED.rle
the horizontal strings from the correctly rendered bitmap image can be pasted directly into ROM
(1.98 MiB) Downloaded 97 times
Thank You !
Attachments
P736-LWSS-MEMunit-with-LoaferPrintHead-128-Registers-Ortho_Polygonal_Number_One.rle
script needed to select image and insert into ROM
(1.56 MiB) Downloaded 99 times
Last edited by otismo on November 1st, 2020, 1:35 pm, edited 2 times in total.
"One picture is worth 1000 words; but one thousand words, carefully crafted, can paint an infinite number of pictures."
- autonomic writing
forFUN : http://viropet.com
Art Gallery : http://cgol.art
Video WebSite : http://conway.life

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

Re: Device Specific Scripting

Post by dvgrn » October 24th, 2020, 11:58 am

otismo wrote:
October 24th, 2020, 10:07 am
after studying a few scripts,

it seems that there are connected .DLLs .LIBs etc.
There really aren't, in most cases -- or rather, the libraries that get used more often are installed as a standard part of the Python language. You do have to add an "import" line at the top of the script to use some features, and sometimes you have to use 'pip' -- the Package Installer for Python -- to go out and get a library if it isn't installed.

If a Golly script contains a line at the top like "from glife import *" -- that's a Golly-specific library; the source code can be found in Scripts/Python/glife.
otismo wrote:
October 24th, 2020, 10:07 am
PM2Ring's script that makes a BitMap Printer,

calls for a "dot matrix printer"

and there is only a bit of .rle pattern code in the whole script.

SO a lot of necessary code is elsewhere.
Nope, all the necessary RLE is right there. A p30 bitmap printer has a lot of duplication, and really doesn't need a lot of RLE.

-- At least, that's true if you're talking about this version. There were some versions posted before that, that only work from the Python command line, or only work with Golly 1.x. They do some unnecessarily complicated things with 'exec', writing out a Python script that then builds the pattern, etc. Just don't look at those versions until you've made sense of the version I linked to.

You wouldn't technically need arrays, because you could use the Golly universe itself as data storage -- but there are in fact arrays in PM 2Ring's code. Have a look at get_bitmap() -- it's all fairly standard stuff.

Post Reply