This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LCA: | |
"""Simulate the Linear CA (XOR CA rule) known as Rule 90 on a circular grid | |
Usage: l = LCA(width) OR l = LCA(width, rule) | |
where width is an integer > 1 and rule is one of [18, 90, 150]""" | |
maxbuf = 8 | |
def __init__(self, width, rule=90): | |
if rule == 18: | |
self.stepfun = LCA.step18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#p392_pairs.py | |
# c/98 spaceship generator | |
# Usage: python p392_pairs.py [<start> [<stop>]] | |
# where <start> is the starting value and <stop> is the final value for the | |
# phase of the LHS (default is 0 <= phase < 196) | |
# | |
# Example usage with apgluxe: | |
# $ cd apgmera | |
# $ ./recompile.sh --rule b2k3acijr4ijqy6i7cs2aek3ijnqr4it5n --symmetry stdin_c98_pairs | |
# $ mv apgluxe apgluxe-stdin_c98_pairs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#sort-collisions.py | |
# Read in unsorted glider collisions lines from all files on command line | |
# Output sorted collisions to first file in synthesise-constellation.py format | |
# Collisions are in a modified version of Shinjuku's component format: | |
# - single line containing apgcode of output constellation, followed by | |
# - multiple lines containing components producing that constellation with | |
# the out_apgcode omitted | |
# Input files can be in either format | |
# For Python3 print function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#4Gconstellation-gsets.py | |
"""Generate a batch of 4 glider collisions and report those which result | |
in stable constellations. Converts collisions to Shinjuku's gliderset format | |
and outputs comp lines. This version generates a subset of 4G collisions for | |
use with synthesise-constelation.py v2.0 | |
Usage: | |
$ python 4Gconstellation-gsets.py > <compfile>.sjk | |
Based on popseq.c by Chris Cain | |
Includes a (slightly modified) version of shinjuku/glidersets.py and the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstring> | |
#include "LifeAPI.h" | |
int main(int argc, char *argv[]) { | |
int pops[16], allpops[256]; | |
char s[1024], line[1024]; | |
s[0] = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#count_active.py | |
# Count active cells within the envelope of a moving pattern | |
import golly as g | |
import numpy as np | |
r = g.getrect() | |
if not r: | |
g.exit('No pattern') | |
patt = g.getcells(r) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import re | |
import sys | |
import argparse | |
def fail(msg): | |
sys.stderr.write(sys.argv[0] + ": " + msg + "\n") | |
sys.exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sssViewer.py v0.3 | |
# Golly Python script to peview patterns in sss format | |
# Author: Arie Paap | |
import re | |
import time | |
from timeit import default_timer as timer | |
import golly as g | |
# Check if pattern is in view and shift view / resize if necessary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Random State Distribution | |
A rule generator for Golly to create a random state distributor rule | |
The rule is intended to convert a two state random soup pattern into an n-state random soup. The rule has (n+1)-states where the additional state is state 1. All state 1 cells will become cells with state 2 -> n after the first generation, with the resulting state being dependent on the neighbourhood configuration of the cell. | |
This could potentially be used with apgsearch to generate multi-state soups in rules where 2-sate soups don't show the full dynamics of the rule. | |
This project contains three separate files: | |
- rand_state_distribution.py | |
A Golly Python script to generate a rule file (can be run from clipboard). | |
- test_rand_state_distribution.py |
NewerOlder