UnLife: a Life pattern precursor generator

Quinapalus Home :: Things Technical :: UnLife: a Life pattern precursor generator
Life pattern at generation 0 Life pattern at generation 1

Introduction

Read this first.

Given a pattern P and an integer n, UnLife attempts to find a pattern Q such that P is the nth-generation descendant of Q. The main advantage of the program is that it is very short: it is much simpler than others that perform the same task because all the complexity is devolved to a sophisticated general-purpose constraint satisfaction library. Despite this the performance of the program is surprisingly good.

History and motivation

The first version of the program, handling only the case n=1, was written to create a puzzle for Pablo’s Armchair Treasure Hunt 2014: see page 5 of the puzzle and page 5 of the solution PDF. The version of the code given here has been extended to cover general n.

Download

First install the PicoSAT library. On Linux machines running Debian or a derived distribution, this can be done using the following command.

sudo apt-get install picosat

Alternatively, the source code for the library can be downloaded here.

Download the source code (MIT licence). The comments in the code explain how to modify it to specify the desired result pattern P and the value of n.

Compile and run the program. On Linux machines the following commands can be used.

gcc unl-ng.c -l picosat
./a.out

The program outputs the result pattern Q and its subsequent generations to stderr, and a file containing Q suitable for loading into GtkLife or Golly to stdout. If it fails to find a solution it outputs Unsatisfiable to stderr. The source code explains the use of the single optional command-line argument.

Comments or questions? Please contact me at the e-mail address on the home page.


This page most recently updated Fri 5 Jan 10:25:32 GMT 2024
Word Matcher

Options...
Type a pattern, e.g.
h???o
into the box and click ‘Go!’ to see a list of matching words. More...


Qxw screen
Qxw is a free (GPL) crossword construction program. New! Release 20200708 for both Linux and Windows. Non-Roman alphabets, batch mode, multiplex lights, answer treatments, circular and hex grids, jumbled entries, lots more besides. More...

You can order my book, ‘Practical Signal Processing’, directly from CUP or via Hive, Amazon UK or Amazon US.
Practical Signal Processing front cover
“Probably the best book on signal processing ever written” — review at Goodreads.
Wydanie polskie.

If you find this site useful or diverting, please consider a donation to NASS (a UK registered charity), to KickAS (in the US), or to a similar body in your own country.

Copyright ©2004–2024.
All trademarks used are hereby acknowledged.