UnLife: a Life pattern precursor generator
Quinapalus Home :: Things Technical :: UnLife: a Life pattern precursor generator
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.
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
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 4 Feb 16:49:54 GMT 2022
New: ARM Cortex-M7 cycle counts and dual-issue combinations; Free, fast, and compact ARM Cortex-M0 single- and double-precision floating-point library; Offline SOWPODS checker
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.
“Probably the best book on signal processing ever written” — review at Goodreads.
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.
All trademarks used are hereby acknowledged.