Skip to content

Instantly share code, notes, and snippets.

View import-RLE.py
#importRLE.py import multiple rle encoded patterns from a string on the clipboard
import golly as g
import os
from math import ceil, floor, sqrt
txt = g.getclipstr()
constructPatt = False
rleList = []
View gfind-zakai.c
/*
** gfind 4.9 -- search for gliders in semitotalistic cellular automata
** David Eppstein, UC Irvine, 7 Mar 1998
**
** This program performs very fast searches for low-period gliders. For example,
** in Conway's Life, it can find a 10x12 c/3 spaceship instantaneously: try
** gfind b3/s23/o3v/l36
** (This set of arguments means rule B3/S23 (Life); c/3 orthogonal,
** even bilateral symmetry, level of difficulty = 36. Run gfind without
** arguments and type return to the prompt for a full list of options.)
View !LLS_Search_Pattern_Files.txt
This gist contains a collection of search pattern files for use with LLS.
They are mostly used to find adjustable ships with "relativistic" speeds in INT CA rules.
There are also a few search patterns for similar searches which don't give relativistic speeds.
Given runtimes are for solver (cadical) only. Preprocessing for most of these files takes
about a minute, up to two minutes.
# Summary of search patterns
# Adjustable period 2c/3 spaceships
1) 2,1c3k_2c3o_adjP_min.txt
@apaap
apaap / adjustable_relativistic_ship2.txt
Last active Jun 18, 2020
LLS search file for a relativistic adjustable spaceship. Based on c/2 push/pull via photon reflection reactions - longer reaction times
View adjustable_relativistic_ship2.txt
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
a1 b1 c1 d1 0 0 0 2 3 4 5 0 0 42 43 44 45 0 0 0 0
e1 f1 g1 h1 0 0 0 6 7 8 9 0 0 46 47 48 49 0 0 0 0
i1 j1 k1 l1 0 0 0 10 11 12 13 0 0 50 51 52 53 0 0 0 0
m1 n1 o1 p1 0 0 0 14 15 16 17 0 0 54 55 56 57 0 0 0 0
q1 r1 s1 t1 0 0 0 18 19 20 21 0 0 58 59 60 61 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
@apaap
apaap / adjustable_relativistic_ship.txt
Last active Jun 18, 2020
LLS search file for a relativistic adjustable spaceship. Based on c/2 push/pull via photon reflection reactions
View adjustable_relativistic_ship.txt
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
a1 b1 c1 d1 0 0 0 2 3 4 5 0 0 42 43 44 45 0 0
e1 f1 g1 h1 0 0 0 6 7 8 9 0 0 46 47 48 49 0 0
i1 j1 k1 l1 0 0 0 10 11 12 13 0 0 50 51 52 53 0 0
m1 n1 o1 p1 0 0 0 14 15 16 17 0 0 54 55 56 57 0 0
q1 r1 s1 t1 0 0 0 18 19 20 21 0 0 58 59 60 61 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
@apaap
apaap / dump.lua
Created Dec 12, 2019
Progress on determining the fate of the Dean Hickerson's R50 Roomba bug
View dump.lua
-- prtr-dump.lua
-- Module to serialize lua values and tables and dump to file
-- By Jérôme Vuarand
-- http://piratery.net/dump/
-- LICENSE
-- Copyright (c) Jérôme Vuarand
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
@apaap
apaap / 3DCA_iso_neighbourhoods.py
Last active Nov 29, 2019
Enumerate the isotropic neighbourhoods for 3D CA with Moore neighbourhood and 2D range-2 Moore neighbourhood
View 3DCA_iso_neighbourhoods.py
from itertools import combinations, product
import numpy as np
from timeit import default_timer as timer
# Matrix representation of octahedral group (from Wikiversity)
# https://en.wikiversity.org/wiki/Full_octahedral_group#Code
octahedral = { (0, 0): [[ 1, 0, 0], [0, 1, 0], [0, 0, 1]], (0, 1): [[0, 1, 0], [ 1, 0, 0], [0, 0, 1]],
(0, 2): [[ 1, 0, 0], [0, 0, 1], [0, 1, 0]], (0, 3): [[0, 1, 0], [0, 0, 1], [ 1, 0, 0]],
(0, 4): [[0, 0, 1], [ 1, 0, 0], [0, 1, 0]], (0, 5): [[0, 0, 1], [0, 1, 0], [ 1, 0, 0]],
(1, 0): [[-1, 0, 0], [0, 1, 0], [0, 0, 1]], (1, 1): [[0,-1, 0], [ 1, 0, 0], [0, 0, 1]],
@apaap
apaap / fetch_xs19.sh
Created Nov 19, 2019
Update unsynthesized xs19 soup counts
View fetch_xs19.sh
curl -o xs19.txt https://catagolue.appspot.com/textcensus/b3s23/C1/xs19
curl -o xs19-synth.txt https://catagolue.appspot.com/textcensus/b3s23/synthesis-costs/xs19
@apaap
apaap / filter_p392_pairs.py
Last active Nov 19, 2019
Find the smallest ship at each period in the Omosso p392_pairs census
View filter_p392_pairs.py
# Before using this code the textcensus needs to be fetched from Catagolue.
# $curl -o stdin_c98_pairs.txt https://catagolue.appspot.com/textcensus/b2k3acijr4ijqy6i7cs2aek3ijnqr4it5n/stdin_c98_pairs
# Format: "{apgcode}", {count}
import lifelib
import sys
omosso = "b2k3acijr4ijqy6i7cs2aek3ijnqr4it5n"
lt = lifelib.load_rules(omosso).lifetree(memory=4000)
@apaap
apaap / lca.py
Last active Nov 7, 2019
Simulator for ECA rules 18, 90, and 150
View lca.py
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
You can’t perform that action at this time.