Re: The Single Rotation Rule
Posted: July 18th, 2014, 2:39 pm
For work with very big areas with sparse definition of cells instead of import0 function in archive
it is better to use modified version below. And yes, before running the script desired 5-state rule
should be already chosen
Alexander
it is better to use modified version below. And yes, before running the script desired 5-state rule
should be already chosen
Code: Select all
from glife import rect
import golly as g
r = g.getselrect()
if len(r) == 0:
r = g.getrect()
if len(r) == 0: g.exit("There is no selection and the pattern is empty.")
slist = g.getcells(r)
inc = 2
if len(slist) & 1 == 1: inc = 3
for i in xrange(0, len(slist)-1, inc):
col = slist[i]
row = slist[i+1]
s = g.getcell(col,row)
if (s > 0):
g.setcell(col, row, 1 + (col%2) + 2*(row%2))
