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 Mon 16 Jan 11:10:08 GMT 2017
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. Answer treatments, circular and hex grids, jumbled entries, more besides. Release 20140331 for both Linux and Windows. More...

Practical Signal Processing front cover
My book, ‘Practical Signal Processing’, is published by Cambridge University Press. You can order it directly from them, or via amazon.co.uk or amazon.com. Paperback edition now also available. Browse before you buy at Google Books. 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–17.
All trademarks used are hereby acknowledged.