You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(15) |
Aug
|
Sep
(72) |
Oct
(34) |
Nov
(10) |
Dec
(20) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
|
Feb
(22) |
Mar
(9) |
Apr
(11) |
May
(18) |
Jun
(68) |
Jul
(10) |
Aug
(4) |
Sep
(13) |
Oct
(29) |
Nov
(21) |
Dec
(24) |
2007 |
Jan
(32) |
Feb
(19) |
Mar
(11) |
Apr
(14) |
May
(8) |
Jun
(7) |
Jul
(3) |
Aug
|
Sep
|
Oct
(8) |
Nov
(26) |
Dec
(16) |
2008 |
Jan
(1) |
Feb
(4) |
Mar
(4) |
Apr
(25) |
May
(23) |
Jun
(22) |
Jul
(18) |
Aug
(61) |
Sep
(129) |
Oct
(106) |
Nov
(99) |
Dec
(24) |
2009 |
Jan
(6) |
Feb
(2) |
Mar
(29) |
Apr
(84) |
May
(106) |
Jun
(70) |
Jul
(56) |
Aug
(42) |
Sep
(62) |
Oct
(140) |
Nov
(38) |
Dec
(9) |
2010 |
Jan
(19) |
Feb
(15) |
Mar
(32) |
Apr
(36) |
May
(28) |
Jun
(17) |
Jul
(12) |
Aug
(13) |
Sep
(7) |
Oct
(9) |
Nov
(156) |
Dec
(56) |
2011 |
Jan
(53) |
Feb
(25) |
Mar
(6) |
Apr
|
May
(1) |
Jun
(22) |
Jul
(8) |
Aug
(20) |
Sep
(50) |
Oct
(60) |
Nov
(44) |
Dec
(3) |
2012 |
Jan
(2) |
Feb
(11) |
Mar
(32) |
Apr
(35) |
May
(13) |
Jun
(90) |
Jul
(15) |
Aug
(27) |
Sep
(15) |
Oct
(28) |
Nov
|
Dec
|
2013 |
Jan
|
Feb
(119) |
Mar
(91) |
Apr
(68) |
May
(29) |
Jun
(24) |
Jul
(4) |
Aug
(14) |
Sep
(3) |
Oct
(11) |
Nov
(31) |
Dec
(36) |
2014 |
Jan
(48) |
Feb
(1) |
Mar
(23) |
Apr
(14) |
May
(15) |
Jun
(4) |
Jul
(8) |
Aug
(18) |
Sep
|
Oct
(14) |
Nov
|
Dec
(5) |
2015 |
Jan
(2) |
Feb
|
Mar
(11) |
Apr
(3) |
May
(44) |
Jun
(14) |
Jul
(7) |
Aug
(2) |
Sep
(5) |
Oct
(23) |
Nov
(27) |
Dec
(7) |
2016 |
Jan
(15) |
Feb
(22) |
Mar
(23) |
Apr
(41) |
May
(25) |
Jun
(1) |
Jul
(27) |
Aug
(9) |
Sep
(5) |
Oct
|
Nov
(27) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
(3) |
Apr
(2) |
May
(1) |
Jun
(18) |
Jul
(16) |
Aug
(11) |
Sep
|
Oct
(3) |
Nov
|
Dec
|
2018 |
Jan
(11) |
Feb
(2) |
Mar
(3) |
Apr
|
May
(13) |
Jun
(12) |
Jul
(16) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2019 |
Jan
|
Feb
(3) |
Mar
(21) |
Apr
(8) |
May
(12) |
Jun
|
Jul
|
Aug
(4) |
Sep
(4) |
Oct
(2) |
Nov
(5) |
Dec
(16) |
2020 |
Jan
|
Feb
|
Mar
(1) |
Apr
(2) |
May
(16) |
Jun
|
Jul
(10) |
Aug
(24) |
Sep
(31) |
Oct
(17) |
Nov
(4) |
Dec
|
2021 |
Jan
(3) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(12) |
Dec
(10) |
2022 |
Jan
|
Feb
(3) |
Mar
(2) |
Apr
(15) |
May
(4) |
Jun
|
Jul
|
Aug
(15) |
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
(1) |
Apr
(6) |
May
(1) |
Jun
|
Jul
(1) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2025 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(1) |
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
1
(1) |
2
(1) |
3
|
4
|
5
|
6
|
7
|
8
(2) |
9
|
10
|
11
|
12
|
13
|
14
|
15
|
16
|
17
(1) |
18
|
19
|
20
|
21
|
22
|
23
|
24
(2) |
25
(1) |
26
|
27
|
28
|
29
|
30
|
31
|
|
|
From: Andrew T. <an...@tr...> - 2007-05-25 02:46:50
|
> Very nice! And the script is readable and surprisingly short, as > seems to be usual with Python. I had no trouble getting hold of > pop-plot.py or the new text.py, but save-image.py seems to be giving > me a "533 Permission denied" error. Hmm, the permissions were wrong for some reason. Should be ok now, but just in case I've also included the script below. > It will be nice having the "mono" font included in text.py. Might > even provide a useful way to label sub-patterns in some cases. In a > way that seems like a kludgey idea -- really labels should maybe > "float" a little better, and be the same size at all zoom levels... Yep, for smarter annotation and other tricks it might be very useful to have an optional layer drawn above all other layers. As you say, something to think about for Golly 3.0. Andrew ---------- save-image.py ---------- # Use PIL (Python Imaging Library) to save current selection or pattern # in a user-specified image file (.png/.gif/.bmp/.jpg/.tif). # Author: Andrew Trevorrow (an...@tr...), May 2007. from glife import getstring import golly as g try: import Image except: g.exit("You need to install PIL (Python Imaging Library).") if g.empty(): g.exit("There is no pattern.") prect = g.getrect() srect = g.getselrect() if len(srect) > 0: # save selection rather than pattern prect = srect x = prect[0] y = prect[1] wd = prect[2] ht = prect[3] # prevent Image.new allocating a huge amount of memory if wd * ht >= 100000000: g.exit("Image area is restricted to < 100 million cells.") # create a simple black and white image (dead cells are white) g.show("Creating image...") im = Image.new("1", (wd,ht), "white") g.show("Drawing cells...") cellcount = 0 # get a row of cells at a time to minimize use of Python memory for row in xrange(ht): cells = g.getcells( [ x, y + row, wd, 1 ] ) clen = len(cells) if clen > 0: for i in xrange(0, clen, 2): h = cells[i] - x im.putpixel((h,row), 0) # live cells are black cellcount += 1 if cellcount % 1000 == 0: # allow user to abort huge pattern/selection g.dokey( g.getkey() ) if cellcount == 0: g.exit("Selection is empty.") # prompt user for output file (can be .png/.gif/.bmp/.jpg/.tif) outfile = getstring("Output file [default = save.png]:") if len(outfile) == 0: outfile = "save.png" im.save(outfile) g.show("Image saved as " + outfile) # on Mac OS X this opens the image file in Preview import webbrowser import os webbrowser.open("file://" + os.getcwd() + "/" + outfile) |
From: Dave G. <dav...@gm...> - 2007-05-24 17:18:08
|
> One of the nice things about having extra layers is that you can > run an experiment in one layer and plot the results in another. > For example, here is a script that runs the current pattern for > a requested number of steps (using the current step size) and > then creates a simple plot of population vs time: Very nice! And the script is readable and surprisingly short, as seems to be usual with Python. I had no trouble getting hold of pop-plot.py or the new text.py, but save-image.py seems to be giving me a "533 Permission denied" error. It will be nice having the "mono" font included in text.py. Might even provide a useful way to label sub-patterns in some cases. In a way that seems like a kludgey idea -- really labels should maybe "float" a little better, and be the same size at all zoom levels, except maybe optional zoom levels above/below which the label wasn't drawn, and have equations for the location so you could label a moving spaceship or reaction site, and so forth... Could do some of the above with scripts, sort of, but not the invariant-size trick. Still, you know, simplicity is a very great virtue. I think this should successfully keep anyone from tackling labeling and all its attendant complexities until at least Golly 3.0... -- Also, as usual, what's _really_ fun is switching to the plot layer and then turning Conway's Crank for a while and blowing it up. When I start with the population histogram of a pi-heptomino and run it just the right number of ticks, I get a high-resolution image of the Flying Spaghetti Monster. Must mean something... ----------------------------------- I am still hunting for time to concentrate on some contributions to Golly 1.3 -- keyboard shortcuts and scripting improvements and so forth. Looks like the schedule should open up significantly around the middle of June. Just now I'm a month behind on some other promises, and my wife is in the final weeks of her first year of medical school (!). My new job now has me digging through obscure C++ code trying to add new features to an old firmware-loader utility, somewhat more than full time. Which is probably a good thing for my Golly coding abilities in the long run. But in the meantime I sure feel like I'm missing out on Life...! Keep the cheer, Dave |
From: Andrew T. <an...@tr...> - 2007-05-24 00:10:40
|
One of the nice things about having extra layers is that you can run an experiment in one layer and plot the results in another. For example, here is a script that runs the current pattern for a requested number of steps (using the current step size) and then creates a simple plot of population vs time: ftp://ftp.trevorrow.com/beta/pop-plot.py To use the above script you'll also need to get this new version of text.py and put it in Scripts/glife (and restart Golly): ftp://ftp.trevorrow.com/beta/text.py This creates a mono-spaced ASCII font for annotating the plots. (It doesn't really have to be mono-spaced -- that just made it slightly easier to create -- but a fixed-width font might be useful for other purposes.) The resulting plot can be saved to a file with your favorite screen-grabbing tool, or you can use this script: ftp://ftp.trevorrow.com/beta/save-image.py It can save the current pattern (or selection) as a black-on-white image in a variety of formats depending on the given file extension (png/gif/bmp/jpg/tif). The only snag with save-image.py is that you probably need to install PIL (Python Imaging Library) -- it wasn't installed on my Mac so I assume it's not included in the standard Python distribution. [I'm currently "between contracts" so I thought I might as well dabble in a bit of Golly fun until I can find more work.] Andrew |
From: Andrew T. <an...@tr...> - 2007-05-17 00:21:48
|
Mostly to Dave: I've updated the Win and Linux screenshots on our website and at sf. Feel free to replace them at any time. I've also replaced the blue-spheres-Golly title with an animated gif showing Brice's ticker. Animated gifs are not to everybody's taste so if you'd prefer the old title just let me know. (I created the animation for our About box but thought it might also look nice on the website.) Andrew |
From: Andrew T. <an...@tr...> - 2007-05-08 11:47:33
|
Dave: > The download numbers for 1.2 seem pretty healthy for so soon after the > release (at least, downloads aren't limited to just members of the > golly-test list!) but it might be possible to generate a little wider > interest... So the latest sneaky trick is a writeup of the new > hexadecimal counter for Digg.com. ... Doesn't seem to have had much effect, unfortunately. Maybe better to announce Golly 1.2 on some of the big software download sites. If you look at the sf stats we got a big spike in downloads around April 22 when I announced 1.2 at versiontracker.com (probably the most popular site for Mac software announcements). The trouble is I don't know what the best Windows/Linux sites are, so someone else will have to do those. > [script snipped] > > This can be run in either hlife or qlife mode, of course, with fairly > similar results. On some Windows systems I've sometimes seen the > leading end of the fuse move slower and slower and s-l-o-w-e-r as time > goes on, until after only a few thousand (or even a few hundred) ticks > it's just creeping along. ... I see the same slow down on my Mac -- not sure why either. Certainly memory usage is increasing much faster than you'd expect, so maybe you are doing something nasty to Python's garbage collection? > If you comment out the line near the top that breaks the fuse's > initial symmetry to get the quadratic reaction going -- > > # g.setcell(158,0,0) > > -- then you end up with a constant-size pattern moving leftward at the > speak of light ("go west, young ant"?) Memory usage still creeps up, > though not as fast... Sometimes when you stop the script and hit > Ctrl-N to clear out the universe, the memory usage doesn't go back > down all the way -- you sometimes lose three or six or nine megabytes. > That loss doesn't seem to be cumulative, though. That is due to Python I'm afraid -- see Potential Problems in Help > Scripting. Python is not very friendly about releasing memory back to the OS. As you've seen, Python 2.5 is better but still far from perfect. I've asked on comp.lang.python about this and unfortunately there doesn't seem to be any way to reclaim all Python memory after running a script. (Well, there *is* a way, and that's to run the script in a separate process. I actually tried that, passing info to and from the script by redirecting stdin/out, but scripts ran about 20 to 100 times slower.) Andrew |
From: Andrew T. <an...@tr...> - 2007-05-08 11:00:07
|
Dave: [sorry for late reply -- been super busy this week] > So ObjectDB.sof doesn't have the newline problem -- on my system, > anyway! What I'm curious about is whether Python handles Mac-style > line endings differently when it's running on a Mac. Could someone > please let me know whether these scripts run OK on MacOS and/or Linux? Seem to run ok on my Mac. (I did find it a bit confusing that if I entered an invalid path then I didn't get any sort of error message, just one live cell at 0,0 and then the script exits.) > Not surprisingly, maximizing the window also slows things down, > apparently proportional to the change in screen area. Is this the > same on other platforms? Are there any display tricks that might > reduce the impact of drawing all those gridlines? See the comments at the top of wxrender.cpp. There are probably a number of things we could do to reduce the amount of unnecessary drawing we're currently doing. Andrew |
From: Dave G. <dav...@gm...> - 2007-05-02 11:40:18
|
First, a quick side note: I've been playing around trying to get a few more people to notice (and download) Golly 1.2; I'm thinking there are a lot more people out there who would be interested if they knew about it -- at least to the extent of looking through the pattern collection and gratuitously blowing a few things up. (You have to start somewhere.) The download numbers for 1.2 seem pretty healthy for so soon after the release (at least, downloads aren't limited to just members of the golly-test list!) but it might be possible to generate a little wider interest... So the latest sneaky trick is a writeup of the new hexadecimal counter for Digg.com. You can vote for it if you've a mind to: http://digg.com/software/Cells_within_cells_in_Conway_s_Life_now_counting_in_hexadecimal As it happens, there was a lot of excitement on Digg recently about a different two-digit hex sequence... maybe it's a good omen for this article. Anyway, I kind of suspect that that's why it got a vote within a minute or two of my hitting the Submit button... ------------------------------ Okay, back to our regularly scheduled programming. The three scripts quoted below can be downloaded from http://cranemtn.com/life/files/test-scripts.py Here's a script that maintains an unsupportable "ants" quadratic lightspeed fuse for long enough to see its long-term behavior -- or for as long as you want: # ---------------------------------start of quadfuse script, version 1 --- # Extend an ants wick indefinitely to show the development # of a lightspeed fuse with quadratically growing population. # This version extends the ants fuse one tick at a time # Author: Dave Greene, 13 March 2007 import golly as g from glife import * from time import sleep rule () # Life ants = pattern("2b2o$2o$2o$2b2o!") fuse = pattern() for fuse_end in range (0, 32): fuse += ants(5 * fuse_end, 0) fuse_end=-1 fuse.display("quadfuse") g.setcell(158,0,0) g.fit() g.show("Press +, -, *, /, or f to control the pattern, or ESC to exit.") # annoying melodramatic pause g.update() sleep(1) # now start running the timer ticks=0 fuse_step=1 fuse_target=0 display_step=1 display_target=0 while True: ch = g.getkey() if len(ch) > 0: if ch=="+" or ch=="=": # override defaults here to get smaller step size display_step *= 2 elif ch=="-" or ch=="_": if display_step != 1: display_step /= 2 else: # elif ch=="*" or ch=="/" or ch=="f": g.dokey(ch) # just pass these keys through and let Golly handle them g.run(1) g.setcell(fuse_end,1,1) g.setcell(fuse_end,2,1) fuse_end-=1 if ticks==display_target: g.update() display_target+=display_step ticks+=1 g.show("") # clear the script message before exiting # ---------------------------------end of quadfuse script, version 1 --- This can be run in either hlife or qlife mode, of course, with fairly similar results. On some Windows systems I've sometimes seen the leading end of the fuse move slower and slower and s-l-o-w-e-r as time goes on, until after only a few thousand (or even a few hundred) ticks it's just creeping along. Not sure why this is yet, and I can't always duplicate it -- maybe Windows is starting to page to the hard drive more and more, or something obvious like that. I've seen this same behavior in previous scripts and previous Golly versions -- mostly in fuse-watcher.py, which this latest script is somewhat based on, and in the "flyover" script. If you comment out the line near the top that breaks the fuse's initial symmetry to get the quadratic reaction going -- # g.setcell(158,0,0) -- then you end up with a constant-size pattern moving leftward at the speak of light ("go west, young ant"?) Memory usage still creeps up, though not as fast... Sometimes when you stop the script and hit Ctrl-N to clear out the universe, the memory usage doesn't go back down all the way -- you sometimes lose three or six or nine megabytes. That loss doesn't seem to be cumulative, though. Here's a version of the above that allows pressing the + and - keys to jump any 2^n ticks up to 512 between display updates. The script only modifies the universe once every 512 ticks in any case. Hitting the + key several times can get the memory usage up to something like 3MB per second on my system. -- Quite possibly there's nothing wrong about any of this; just figured I'd document it while I was looking at it. I think things may have gotten considerably better since I switched to Python 2.5, which wouldn't be at all surprising of course. I've also appended another script that I wrote some time ago, an attempt at an April Fool's joke that I luckily thought better of, where the scripting system gets an unusual amount of exercise -- cells are removed and re-added with every tick. I found this to be rather slow, and sometimes progressively slower, on some old <1GHz machines, but again I didn't see a clear pattern. Think of it as an instantiation of one of those "person from Porlock"-type dreams where you discover something utterly amazing, and then it gets tragically lost due to an annoying interruption. You have to hit Enter a couple of times to get things going, since the script evilly tries to pretend that there's no script running... and then wait a while to get to the punch line. ------------------------------ If anyone feels like using these as test cases for various platforms and machine specs, please go for it -- let me know if any odd behavior shows up. In any case the scripts are kind of fun to watch, once or twice at least. Keep the cheer, Dave # ---------------------------------start of quadfuse script, version 2 --- # Extend an ants wick indefinitely to show the development # of a lightspeed fuse with quadratically growing population # The wick is lengthened whenever it runs out, every 512 ticks. # Author: Dave Greene, 13 March 2007 import golly as g from glife import * from time import sleep g.setrule("b3/s23") # Life ants = pattern("2b2o$2o$2o$2b2o!") fuse = pattern() for fuse_end in range (0, 205): fuse += ants(5 * fuse_end, 0) g.new("Quadratic 'ants' fuse") g.show("Press +, -, *, /, or f to control the pattern, or ESC to exit.") ticks=0 fuse_step=1 fuse_target=0 display_step=1 display_target=0 fuse_extend_target=0 fuse_end=-1 increase_display_step=0 while True: ch = g.getkey() if len(ch) > 0: if ch=="+" or ch=="=": # override defaults here to get smaller step size if display_step<512: increase_display_step=1 elif ch=="-" or ch=="_": if display_step != 1: display_step /= 2 else: g.dokey(ch) # handles *, /, f, arrow keys, etc. # weird detail: can only increase step size if increase_display_step==1 and ticks % (display_step*2) == 0: display_step *= 2 increase_display_step=0 if ticks==fuse_extend_target: fuse_extend_target+=512 # must be of the form 5n+2 to work fuse_end-=512 g.putcells(fuse,fuse_end, 0, 1, 0, 0, 1) g.setcell(fuse_end,1,0) g.setcell(fuse_end,2,0) if ticks==0: # a few corrections to make when first starting -- g.setcell(510,0,0) g.setcell(450,-30,1) g.setcell(451,-30,1) g.setcell(450,-31,1) # block the escape of two gliders g.setcell(300,-100,1) g.setcell(301,-100,1) g.setcell(300,-101,1) g.fit() g.setmag( g.getmag() - 2 ) g.update() sleep(1) # annoying melodramatic pause else: # fix the not-quite-correct overlap with the next 'ants' segment g.setcell(fuse_end+1025-1,-1,1) g.setcell(fuse_end+1025-2,1,0) g.setcell(fuse_end+1025-2,2,0) g.setcell(fuse_end+1025-1,4,1) g.run(display_step) if ticks==display_target: g.update() display_target+=display_step ticks+=display_step g.show("") # clear the script message before exiting # ---------------------------------end of quadfuse script version 2 --- # ---------------------------------start of wish-watcher script --- # Build four "reflectors" at requested separations and watch them run... # hit Enter a couple of times and wait a while to see the second half. # Author: Dave Greene, 1 April 2007. from glife import getstring, validint from time import sleep import os import golly as g from glife import * def monitor(x,y): # make sure reflection reaction is successful. g.setcell(x,y,1-g.getcell(x,y)) def main(): answer = getstring("Enter NE/SW and NW/SE separation (N or N,M):") nm = answer.replace(","," ").split() if len(nm) == 0: n=3 m=3 # extract NE/SW and NW/SE distances else: if not validint(nm[0]): g.error("Bad NE/SW value: " + nm[0]) return n = int(nm[0]) if len(nm)>1: if not validint(nm[1]): g.error("Bad NW/SE value: " + nm[1]) return m = int(nm[1]) else: m=n all=pattern("15bo$13b3o$12bo$12b2o3$10bo$11bo$9b3o2$2b2o$bobo5b2o$bo7b2o$2o6$8b2o$8b2o!",-3,-7)\ +pattern("2o$bo$bobo$2b2o2$11b2o$11b2o6b2o$19b2o5$10b2o$10bo$11b3o$13bo!",13+n,-12-n)\ +pattern("6b2o$6b2o6$14b2o$5b2o7bo$5b2o5bobo$12b2o7$2b2o$3bo$3o$o!",8+n-m,-33-n-m)\ +pattern("7bo$7b3o$10bo$9b2o5$2o$2o6b2o$8b2o2$17b2o$17bobo$19bo$19b2o!",-13-m,-23-m) all.display("A Wish Come True... thanks to the All-Powerful Hand of Golly") g.fit() g.setmag(g.getmag()-1) g.update() reflector_monitor = dict( [ (49, [4,11]), (55, [4,11,7,11]),\ (107+4*n, [31+n,-4-n]), (113+4*n, [31+n,-4-n,31+n,-7-n]),\ (165+4*n+4*m, [16+n-m,-31-n-m]), (171+4*n+4*m, [16+n-m,-31-n-m,13+n-m,-31-n-m]),\ (223+8*n+4*m, [-11-m,-16-m]), (229+8*n+4*m, [-11-m,-16-m,-11-m,-13-m]) ] ) osc_period=232+8*n+8*m megamaid=pattern(""" 16b3o5b3o5b3o5b3o5b3o5b3o5b3o5b3o5b3o5b3o5b3o5b3o5b3o$15bo3bo3bo3bo3bo 3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo$10b3ob o5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bob3o$9b o2b3o5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5b3o 2bo$8bo3bobob3obobob3obobob3obobob3obobob3obobob3obobob3obobob3obobob 3obobob3obobob3obobob3obobob3obobo3bo$8bo5bobobobobobobobobobobobobobo bobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobo bobobo5bo$10bo3bo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bo bo5bobo5bo3bo$7bobo5bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo 3bo3bo3bo3bo3bo3bo3bo3bo3bo5bobo$6b2obob2o105b2obob2o$5bobobob2o105b2o bobobo$4b2o3bo2bo105bo2bo3b2o$3bo3bobo2b2o103b2o2bobo3bo$6bo117bo$3b2o 11b3o5b3o5b3o5b3o5b3o5b3o5b3o5b3o5b3o5b3o5b3o5b3o5b3o11b2o$15bo3bo3bo 3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo$ 10b3obo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bo b3o$9bo2b3o5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bob o5b3o2bo$8bo3bobob3obobob3obobob3obobob3obobob3obobob3obobob3obobob3ob obob3obobob3obobob3obobob3obobob3obobo3bo$8bo5bobobobobobobobobobobobo bobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobo bobobobobo5bo$10bo3bo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bob o5bobo5bobo5bo3bo$7bobo5bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3b o3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo5bobo$6b2obob2o105b2obob2o$5bobobob2o 105b2obobobo$4b2o3bo2bo105bo2bo3b2o$3bo3bobo2b2o103b2o2bobo3bo$6bo117b o$3b2o11b3o5b3o5b3o5b3o5b3o5b3o5b3o5b3o5b3o5b3o5b3o5b3o5b3o11b2o$15bo 3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo 3bo3bo$10b3obo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo 5bobo5bob3o$9bo2b3o5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bobo 5bobo5bobo5b3o2bo$8bo3bobob3obobob3obobob3obobob3obobob3obobob3obobob 3obobob3obobob3obobob3obobob3obobob3obobob3obobo3bo$8bo5bobobobobobobo bobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobo bobobobobobobobobobo5bo$10bo3bo5bobo5bobo5bobo5bobo5bobo5bobo5bobo5bob o5bobo5bobo5bobo5bobo5bo3bo$7bobo5bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo 3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo3bo5bobo$6b2obob2o105b2obob2o$ 5bobobob2o105b2obobobo$4b2o3bo2bo6b3ob3o78b3o11bo2bo3b2o$3bo3bobo2b2o 4bo2bobo2bo76bo3bo9b2o2bobo3bo$6bo10bo3bobo3bo68b3o3bo5bob3o11bo$3b2o 12bo9bo67bo3bo2bo5b3o2bo12b2o$19bo5bo62b3o3bo5bobob3obobo3bo$16bobo7bo bo58bo3bo2bo5bobobobobo5bo$15b2obob2ob2obob2o18b3o29b3o3bo5bobob3obobo 5bo3bo$14bobobo2bobo2bobobo16bo3bo27bo3bo2bo5bobobobobo2bo3bo5bobo$13b 2obo4bobo4bob2o10b3obo5bo3b3o13b3o3bo5bobob3obobo5bo9b2obob2o$12bo3bob 2obobob2obo3bo8bo2b3o5bo2bo3bo11bo3bo2bo5bobobobobo2bo3bo10b2obobobo$ 18b3o3b3o13bo3bobob3obobo5bo3b3o3bo5bobob3obobo5bo17bo2bo3b2o$12b2ob2o b2o5b2ob2ob2o7bo5bobobobobo5bo2bo3bo2bo5bobobobobo2bo3bo17b2o2bobo3bo$ 11bo21bo8bo3bo5bobob3obobo5bobob3obobo5bo31bo$12bo3bo2bo5bo2bo3bo6bobo 5bo3bo2bobobobobo5bobobobobo2bo3bo34b2o$15bo3bo5bo3bo8b2obob2o9bo5bobo b3obobo5bo$17bo9bo9bobobob2o10bo3bo2bobobobo2bo3bo$15bobo9bobo6b2o3bo 2bo17bo5bo$14b2o5b3o5b2o4bo3bobo2b2o17bo3bo$16bo3bo3bo3bo9bo$19bo5bo9b 2o17bo6b2o5b2o6bo31bo$15b2o2bo5bo2b2o23b3o5b2o5b2o5b3o29b3o$17bobob3ob obo18bo5b5o4bo7bo4b5o5bo15bo5b5o3bo$16bo2bobobobo2bo16b3o3b2o3b2o2b2o 7b2o2b2o3b2o3b3o13b3o3b2o3b2ob3o$19bo5bo12bo5b5o2bo2bo2bo2bo9bo2bo2bo 2bo2b5o5bo5b5o2bo2bo2bo3b2o$20bo3bo12b3o3b2o3b2obobobobobobo7bobobobob obob2o3b2o3b3o3b2o3b2obobobobobo2b2o$30bo5b5o2bo2bo2bobobobobo15bobobo bobo2bo2bo2b5o2bo2bo2bobobobobo4bo$29b3o3b2o3b2obobobobobo5bo15bo5bobo bobobob2o3b2obobobobobo5bo4b2o$22bo5b5o2bo2bo2bobobobobo31bobobobobo2b o2bobobobobo10bobob2o$21b3o3b2o3b2obobobobobo5bo31bo5bobobobobobo5bo9b 2obobo$14bo5b5o2bo2bo2bobobobobo47bobobobo16bo3bobob2o$13b3o3b2o3b2obo bobobobo5bo47bo5bo20bo3b2o$8bo3b5o2bo2bo2bobobobobo38b3o37b2o3bob3o$7b 3ob2o3b2obobobobobo5bo37bo3bo13bo5bo25b2o$6b2o3bo2bo2bobobobobo40b3obo 5bo3b3o5b2o5b2o5b3o$5b2o2bobobobobobo5bo39bo2b3o5bo2bo3bo3bo9bo3bo3bo$ 6bo4bobobobo46bo3bobob3obobo5bo15bo5bo3b3o$5b2o4bo5bo46bo5bobobobobo5b o2b2o7b2o2bo5bo2bo3bo$3b2obobo57bo3bo5bobob3obobo11bobob3obobo5bob3o$ 4bobob2o7bo45bobo5bo3bo2bobobobo2bo9bo2bobobobobo5b3o2bo$b2obobo3bo6b 2o5b3o35b2obob2o9bo5bo15bo5bobob3obobo3bo$b2o3bo12bo3bo3bo33bobobob2o 10bo3bo17bo3bo2bobobobo5bo$b3obo3b2o11bo5bo3b3o25b2o3bo2bo39bo5bo3bo$ 2o16b2o2bo5bo2bo3bo23bo3bobo2b2o39bo3bo5bobo$20bobob3obobo5bo3b3o19bo 17b3o33b2obob2o$19bo2bobobobobo5bo2bo3bo15b2o18bo3bo32b2obobobo$22bo5b obob3obobo5bo3b3o21b3o3bo5bo3b3o25bo2bo3b2o$23bo3bo2bobobobobo5bo2bo3b o19bo3bo2bo5bo2bo3bo23b2o2bobo3bo$30bo5bobob3obobo5bo3b3o5b3o3bo5bobob 3obobo5bo3b3o23bo$31bo3bo2bobobobobo5bo2bo3bo3bo3bo2bo5bobobobobobo5bo 2bo3bo24b2o$38bo5bobob3obobo5bobo5bobob3obobo5bobob3obobo5bo3b3o$39bo 3bo2bobobobobo5bobo5bobobobobo2bo3bo2bobobobobo5bo2bo3bo$46bo5bobob3ob obob3obobo5bo9bo5bobob3obobo5bo3b3o$30bo6b2o8bo3bo2bobobobobobobobo2bo 3bo11bo3bo2bobobobobo5bo2bo3bo$29b3o5b2o15bo5bobo5bo25bo5bobob3obobo5b ob3o$22bo5b5o4bo17bo3bo3bo3bo27bo3bo2bobobobobo5b3o2bo$21b3o3b2o3b2o2b 2o64bo5bobob3obobo3bo$14bo5b5o2bo2bo2bo2bo66bo3bo2bobobobo5bo$13b3o3b 2o3b2obobobobobobo11bo7bo7bo7bo7bo28bo5bo3bo$8bo3b5o2bo2bo2bobobobobo 14b3o5b3o5b3o5b3o5b3o18b2o8bo3bo5bobo$7b3ob2o3b2obobobobobo5bo9bo3b5o 3b5o3b5o3b5o3b5o3bo13b2o15b2obob2o$6b2o3bo2bo2bobobobobo16b3ob2o3b2ob 2o3b2ob2o3b2ob2o3b2ob2o3b2ob3o12bo7b2o7b2obobobo$5b2o2bobobobobobo5bo 15b2o3bo2bo2bobo2bo2bobo2bo2bobo2bo2bobo2bo2bo3b2o10b2o7b2o7bo2bo3b2o$ 6bo4bobobobo22b2o2bobobobobobobobobobobobobobobobobobobobobobo2b2o9bo 8bo7b2o2bobo3bo$5b2o4bo5bo7bo15bo4bobobobobobobobobobobobobobobobobobo bobo4bo9bobo6b2o14bo$3b2obobo16b2o13b2o4bo5bobo5bobo5bobo5bobo5bo4b2o 17bo17b2o$4bobob2o7bo9bo10b2obobo43bobob2o14bobo$b2obobo3bo6b2o20bobob 2o41b2obobo$b2o3bo12bo6b2o8b2obobo3bo39bo3bobob2o$b3obo3b2o17bo7b2o3bo 47bo3b2o$2o16b2o7bo8b3obo3b2o39b2o3bob3o$20bo14b2o57b2o$19bo2$34bo3bo 51bo3bo$33b3ob3o49b3ob3o$32b2obobob2o47b2obobob2o$31b2o7b2o45b2o7b2o$ 32bo7bo47bo7bo$31b2o7b2o45b2o7b2o$29b2obobo3bobob2o16bo7bo16b2obobo3bo bob2o$30bobob2ob2obobo16b3o5b3o16bobob2ob2obobo$27b2obo2bobobobo2bob2o 6bo5b5o3b5o5bo6b2obo2bobobobo2bob2o$27b2obob2obobob2obob2o5b3o3b2o3b2o b2o3b2o3b3o5b2obob2obobob2obob2o$27bobo2bo2bobo2bo2bobo4b5o2bo2bo2bobo 2bo2bo2b5o4bobo2bo2bobo2bo2bobo$26b2ob2o11b2ob2o2b2o3b2obobobobobobobo bob2o3b2o2b2ob2o11b2ob2o$26bo4b2obo3bob2o4bo2bo2bo2bobobobobobobobobob o2bo2bo2bo4b2obo3bob2o4bo$25bobob5o5b5obobobobobobobo5bobo5bobobobobob obob5o5b5obobo$49bobobobo17bobobobo$30bobo7bobo6bo5bo17bo5bo6bobo7bobo $32bo7bo47bo7bo$28b2o6bo6b2o14b3o5b3o14b2o6bo6b2o$28b2o5b3o5b2o13bo3bo 3bo3bo13b2o5b3o5b2o$29bo4b5o4bo9b3obo5bobo5bob3o9bo4b5o4bo$29b2o2b2o3b 2o2b2o8bo2b3o5bobo5b3o2bo8b2o2b2o3b2o2b2o$30bo2bo2bo2bo2bo8bo3bobob3ob obob3obobo3bo8bo2bo2bo2bo2bo$29bobobobobobobobo7bo5bobobobobobobobo5bo 7bobobobobobobobo$33bobobobo13bo3bo5bobo5bo3bo13bobobobo$33bo5bo10bobo 5bo3bo3bo3bo5bobo10bo5bo$32bobo3bobo8b2obob2o17b2obob2o8bobo3bobo$32bo 2bobo2bo7bobobob2o17b2obobobo7bo2bobo2bo$35bobo9b2o3bo2bo17bo2bo3b2o9b obo$33bo5bo6bo3bobo2b2o15b2o2bobo3bo6bo5bo$34b2ob2o10bo29bo10b2ob2o$ 46b2o33b2o!""") wbfn=pattern(""" o3bob4o3b3o2b3o3b2o2bo2bob4o$o3bobo6bo2bobo2bobo2bobobo2bo$obobob3o4b 3o2b3o2b4ob2o3b3o$2ob2obo6bo2bobo2bobo2bobobo2bo$o3bob4o3b3o2bo2bobo2b obo2bob4o3$3o2bo2b2o3bo2bo2bo2b2o3bo2b2o2bobo$o3bobobobo2bo2bobobobobo bobobobobobo$2o2bobob2o3b2obobobob2o2bobobobobobo$o3bobobobo2bob2obobo bobobobobobo2bo$o4bo2bobo2bo2bo2bo2b2o3bo2b2o3bo!""") y=401 + osc_period + n*4 + m*4 wbfn.put(-8,y/2) megamaid.put(-55,y/2-102) run_flag=False try: while True: ch = g.getkey() if ch==" ": run_flag=False if ch==chr(13): run_flag=not run_flag elif ch==" " or run_flag==True: g.select([-8,y/2,37,12]) g.clear(0) g.select([-105,y/2-105,230,2]) g.clear(0) g.select([]) y=y-1 g.run(1) wbfn.put(-8,y/2) monitor_flag=False # avoid triggering continuously when stopped else: g.dokey(ch) # just pass keys through and let Golly handle them # if run_flag==True: # sleep(0) # TODO: work in effects for speed keys here gen=int(g.getgen()) % osc_period if gen in reflector_monitor and monitor_flag==False: monitor_flag=True keycells=reflector_monitor[gen] for i in range(0,len(keycells),2): # disable monitoring if necessary after ship arrives if keycells[i+1]<y/2-120: monitor(keycells[i], keycells[i+1]) g.update() except: g.new("Untitled") # hide incriminating evidence g.show("") # clear the script message before exiting # ----------------------------------------------------- main() # ---------------------------------end of wish-watcher script --- |
From: Dave G. <dav...@gm...> - 2007-05-01 21:04:16
|
Here's something I was working on last year -- pre-Golly 1.0, I see: how time flies... What I wanted to do was to set up a script to do a 'flyover' of objects from Koenig's object database, instead of just a huge stamp collection where you have to do a lot of zooming and panning yourself. I've packaged up a trial flyover script with a small sample file of objects from the database: http://cranemtn.com/life/files/hk-database.zip Here are links to the full collections (as of last year's database): http://pentadecathlon.com/test/class2.zip http://pentadecathlon.com/test/class3.zip Class 1 is still lifes (too many to zip up, and less interesting to fly over). Class 2 is oscillators, and Class 3 is spaceships. Class 2 and Class 3 have about 150,000 objects in them, in 1500+ files, one for each [cell count, period, vector] combination. For the attached sample, I took just the first object from each file... even that ends up being quite a collection. It's sorted (almost) alphanumerically, which means the object sizes and periods are all jumbled together, hopefully in an interesting way. The last two ZIPs above contain Mac-format files, which seemed to need special treatment in my Python script: the line endings weren't recognized by Python, so each multi-line SOF file was read in as one long string. ObjectDB.sof, in my sample archive, is a comma-separated PC format with some extra information [sourcename, cell count, period, vector] in front of each line of SOF. [For them as doesn't remember previous SOF investigations on golly-test, the format is described at http://pentadecathlon.com/objects/definitions/definitions.php .] So ObjectDB.sof doesn't have the newline problem -- on my system, anyway! What I'm curious about is whether Python handles Mac-style line endings differently when it's running on a Mac. Could someone please let me know whether these scripts run OK on MacOS and/or Linux? I want to be a properly cosmopolitan coder here... The script should read plain-vanilla SOF, so if you download and decompress the class2.zip and class3.zip files, you should be able to point the script to the appropriate path to see the entire contents (if you have that much patience, and Golly doesn't run out of memory). Otherwise, if you put the script and ObjectDB folder into Golly's Scripts directory, just hit Enter and you should get the sample ObjectDB collection. You can use arrow keys, mouse wheel, F key, and so forth to look at the patterns going by. You'll find that if the active end of the column of objects gets entirely off the screen, new objects will stop appearing until you get it back onscreen again. If you get bored, hit S to skip 100 patterns at a time. The spaceships start around line #910. + and - keys work to speed up/slow down the display; I haven't put in anything to slow down below the default speed yet (my computer is too slow, so I don't need to) but at low zooms you can at least hit L to turn on the gridlines -- slows my system down significantly, anyway. Not surprisingly, maximizing the window also slows things down, apparently proportional to the change in screen area. Is this the same on other platforms? Are there any display tricks that might reduce the impact of drawing all those gridlines? The next refinement is to pack in as many objects as can fit in the current screen width, before moving down to the next line. Should work nicely for oscillators, but of course it's trickier for spaceships (unless they're all going the same speed and direction). Don't know how soon I'll be able to get back to this project, though -- maybe next year... Keep the cheer, Dave Greene # ------------------------ text of script follows: --------------------------- # Display and run all Koenig SOF files in a folder chosen by the user. # Author: Dave Greene, 29 May 2006; updated 29 April 2007. # still need to add an ambitious (but not too ambitious!) pattern deletion system # (probably throttle up and down depending on how many rows in the total pattern) from glife import * import golly as g import os from os.path import join from time import time global display_step, basex display_step=1 basex=999999 # ------------------------------------------------------------------------------ def flyover (): basedir=getstring("Enter path of folder to display: ") if basedir=="": basedir=os.path.join(golly.appdir() + "Scripts","ObjectDB") g.new("HK Database Flyover") g.setcell(0,0,50) # lazy way to be sure of not getting degenerate getrect[] result g.setmag(g.getmag()-2) for root, dirs, files in os.walk(basedir): for name in files: # ignore hidden files (like .DS_Store on Mac) if name.endswith(".sof") and not name.startswith("."): fullname = join(root, name) runSOF(fullname) if "CVS" in dirs: dirs.remove("CVS") # don't visit CVS directories def runSOF (fname): global display_step, basex f=open(fname, 'r') count=0 skipNobjects=0 for chunk in f: # Python has some annoying trouble with Mac-style line endings, # so we have to make everything look right no matter what: # in Mac format, entire file will be here, separated by chr(10) for line in chunk.split(chr(10)): if line=="": continue count+=1 if skipNobjects>0: # skip objects if S key pressed skipNobjects-=1 continue g.show(fname + ", line " + str(count)) bounds=g.getrect() x=int(bounds[0]) y=int(bounds[1]) w=int(bounds[2]) h=int(bounds[3]) # set x location so that column won't drift if bounding box changes if basex==999999: basex=x linedata=line.split(",") if len(linedata)==1: # need more vertical space here, since we don't know the object types # (could look at the filenames, but that's what the CSV database format is for.) end_y=showSOF(linedata[0], basex, y + h + 32) else: # modified SOF database has comma-separated sourcename, cells, period, vector if linedata[3]=="H0V0": end_y=showSOF(linedata[4], x, y + h + 10) elif linedata[3][-2:]=="V0": # objects are displayed reflected in Golly's x=y line, # so an HnV0 object actually shows up going north, # and should be offset so avoid collisions. # The calculation below sorts vertical-travelling spaceships # by speed, though 2c/5 spaceships show up with dangerously little room, # and there are a few collisions in the current sample database. end_y=showSOF(linedata[4], basex + 128*int(linedata[2]) / int(linedata[3][1:-2]) - 160, y + h + 10) else: end_y=showSOF(linedata[4], basex, y + h + 50) g.update() while not g.visrect( [x, end_y, 1, 1] ): # this didn't work reliably at low zooms (?!) # stop autoscrolling when new object's last row is on screen (or parallel) g.run(display_step) g.update() # autoscrolling happens here pos = g.getpos() g.setpos(pos[0],str(int(pos[1])+display_step)) # keyboard handling while 1: ch=g.getkey() if ch=="+": display_step = (display_step + 1)*2 - 1 elif ch=="-": if display_step != 1: display_step = (display_step + 1)/2 - 1 elif ch=="s" or ch=="S": skipNobjects=100 elif ch=="": break else: g.dokey(ch) f.close() def showSOF (sofString, x, y): # process the SOF and produce an object at chosen location # current databases seem to work best with objects reflected in Golly's x=y cur_x = x cellState=1 for ch in sofString: if ch=='-': cur_x=x y+=1 cellState=1 elif ch=='.': break else: runlength=ord(ch)-48 while runlength>0: if cellState==1: g.setcell(cur_x, y, cellState) cur_x+=1 runlength-=1 else: cur_x+=runlength break cellState=1-cellState return y # ------------------------------------------------------------------------------ # remember initial hashing state so we can restore it if changed by a pattern file inithash = g.getoption("hashing") # show status bar so user sees messages initstatus = g.setoption("showstatusbar", True) # hide other stuff to maximize the viewport # (don't switch to fullscreen because user won't see pattern name in title) initlayerbar = g.setoption("showlayerbar", False) inittoolbar = g.setoption("showtoolbar", False) initscripts = g.setoption("showscripts", False) initpatterns = g.setoption("showpatterns", False) initgrid = g.setoption("showgrid", False) try: flyover() except: g.show("") g.setoption("hashing", inithash) g.setoption("showstatusbar", initstatus) g.setoption("showlayerbar", initlayerbar) g.setoption("showtoolbar", inittoolbar) g.setoption("showscripts", initscripts) g.setoption("showpatterns", initpatterns) g.setoption("showgrid", initgrid) |