Git Product home page Git Product logo

gol-sat's Introduction

GoL-SAT

A SAT-based forward/backwards solver for Conway's "Game of Life".

Compile

  1. Make sure git, cmake, and boost::program_options are installed
  2. Clone the repository: $ git clone https://github.com/flopp/gol-sat
  3. Change into the newly created directory: $ cd gol-sat
  4. Build: $ make

Usage

Run $ bin/gol-sat -e X pattern.txt to perform a backwards computation consisting of X steps an finally yields the pattern specified in the file pattern.txt.

Run $ bin/gol-sat -f -e X pattern.txt to perform a forward computation consisting of X steps starting with the pattern specified in the file pattern.txt.

Pattern Format

The text file format used for patterns starts with two numbers specifying the width and height of the pattern. Then width * height cell characters follow, where

  • . or 0 is a dead cell
  • X or 1 is an alive cell
  • ? is an unspecified cell

The patterns subdirectory contains some samples.

Example

The following command performs backwards computation consisting of two evolution steps (option -e 2) that finally yield the game of life pattern specified in the file patterns/smily.txt:

$ bin/gol-sat -e 2 patterns/smily.txt
-- Reading pattern from file: patterns/smily.txt
-- Building formula for 2 evolution steps...
-- Setting pattern constraint on last generation...
-- Solving formula...

-- Initial generation:
...X.....XX
..X....X...
.X..X....XX
.X.XXX.XX..
..X...XX...
....X..X...
X.X....XXXX
X.XX.X.....
......X..XX
...X.X..X..

-- Evolves to:
...........
..XX....X..
.X..XXXX.X.
.X.XXX.XXX.
..X........
.X.X.....X.
..X.X.XXXX.
..XX..XX...
..XX.XX..X.
.........X.

-- Evolves to final generation (from pattern):
...........
..XXXXXXX..
.X.......X.
.X.X...X.X.
.X.......X.
.X.X...X.X.
.X..XXX..X.
.X.......X.
..XXXXXXX..
...........

gol-sat's People

Contributors

flopp avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

gol-sat's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.