Plus-Minus (+/-) Rules
Posted: May 3rd, 2010, 2:00 pm
Hi!
I've implemented a new way to define generations-like rules. Maybe someone has done this before, I don't know. Anyway, it creates rules with interesting behaviors.
How it works
This rules use the sum of the values of its neighbors. For example, in a +4 rule, every cell whose neighbors add to 4 will increment its value by 1 in the next generation:
Rules are defined using the format +X-Y:Z (i.e: +5-4-6:3, +6+12-5:4), where +X means the number that neighbors need to add to for a cell to increment its value, -Y means the number that neighbors need to add to for a cell to NOT decrement its value, and :Z is the number of generations (allowed "values"). When saving the rule to a file, the ":" symbol is not allowed, so I use "c" (i.e. +4-5-6c3.tree)
How to create new rules
To create rules, you need the make-ruletree.py Golly script (from here: http://ruletablerepository.googlecode.c ... uletree.py )
Then, copy the following script to your clipboard (modify name, n_states, states, plus and minus to match your desired rule) and run make-ruletree.py from Golly:
It will generate a RuleTree. Hope it's not too complex, I can't think of a way to simplify it any further.
Interesting rules
+4-5-6:3 (+4-5-6c3.tree -> http://tinypaste.com/5bca2 )
This rule shows Life-like behavior. Tends to expand infinitely, but only because of a very common puffer that appears often; without that puffer, it settles down. Has a lot of different still life, oscillators and spaceships. Lines of width 1 act as "walls"
+4-6-7-8-9-10:4 (+4-6-7-8-9-10c4.tree -> http://tinypaste.com/499d8d )
This rule has a lot of different and complex still lifes, yet it stabilizes quickly. It also has a surprisingly slow and complex spaceship that appears from a really simple pattern:
And... that's it. If you're interested in any of this or other rules, consider creating another thread (I was going to create one for +4-5-6:3, but I don't want to flood the forum)
Ask me anything!
I've implemented a new way to define generations-like rules. Maybe someone has done this before, I don't know. Anyway, it creates rules with interesting behaviors.
How it works
This rules use the sum of the values of its neighbors. For example, in a +4 rule, every cell whose neighbors add to 4 will increment its value by 1 in the next generation:
Code: Select all
101 200 100
1X0 2X0 0X0
010 000 102
How to create new rules
To create rules, you need the make-ruletree.py Golly script (from here: http://ruletablerepository.googlecode.c ... uletree.py )
Then, copy the following script to your clipboard (modify name, n_states, states, plus and minus to match your desired rule) and run make-ruletree.py from Golly:
Code: Select all
name = "+4-5-6c3"
n_states = 3 # must match states
n_neighbors = 8
def transition_function(a):
# +4-5-6:3
plus = [4] # +x
minus = [5,6] # -x
states = 3 # must match n_states
p = 0
m = 0
n = a[0] + a[1] + a[2] + a[3] + a[4] + a[5] + a[6] + a[7]
for i in plus:
if n == i:
p = 1
for i in minus:
if n == i:
m = 1
if p == 1:
if a[8] == (states - 1):
return a[8]
else:
return a[8] + 1
if m == 0:
if a[8] == 0:
return a[8]
else:
return a[8] - 1
return a[8]
Interesting rules
+4-5-6:3 (+4-5-6c3.tree -> http://tinypaste.com/5bca2 )
This rule shows Life-like behavior. Tends to expand infinitely, but only because of a very common puffer that appears often; without that puffer, it settles down. Has a lot of different still life, oscillators and spaceships. Lines of width 1 act as "walls"
+4-6-7-8-9-10:4 (+4-6-7-8-9-10c4.tree -> http://tinypaste.com/499d8d )
This rule has a lot of different and complex still lifes, yet it stabilizes quickly. It also has a surprisingly slow and complex spaceship that appears from a really simple pattern:
Code: Select all
x = 2, y = 3, rule = +4-6-7-8-9-10c4
C$CA$.C!
Ask me anything!