GithubHelp home page GithubHelp logo

danielvukelich / conway-ncurses Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 46 KB

An Ncurses implementation of Conway's Game of life and other Cellular Automaton rules

License: GNU General Public License v3.0

Makefile 3.35% C 92.45% C++ 4.20%

conway-ncurses's Introduction

conway-ncurses

An Ncurses implementation of Conway's Game of Life and other cellular automaton rules

Building

Build a debug version with make, and a version without debug symbols by running make release. The program will be put in the build/ directory. Make sure that you have ncurses-dev or your distro's equivalent package installed.

Running

Running the program without any arguments will launch a random game with Conway's rules. To exit, press 'q'. To pause, press space. When you are paused, you can press 's' to step forward one generation at a time.

The program supports the following optional command line arguments:

  • --file <path> or -f <path>: Loads a Life 1.05 file describing a pattern and optional ruleset.
  • --seed <num> or -s <num>: When generating a random game, 1/num of every cell will be seeded 'alive'. The higher num, the more cells will start as 'dead'. The seed is not allowed to be a value less than 1.
  • --rule <string> or -r <string>: Tells the game what rules determine how cells live and die. If a file input is specified and that file uses tags that tell what ruleset to use, the file's rules will take precedence. Specify rules in the standard Alive/Born format. Eg: Conway's original rules are that a living cell will continue to live if it has 2 or 3 living neighbours, and a dead cell will be reborn if it has exactly 3 living neighbours. This ruleset would be passed as --rule 23/3. If you wanted cells to stay alive if they have an even number of living neighbours and dead cells to be born if they have exactly 1 neighbour, you would use the ruleset --rule 2468/1. Note that since a cell cannot have more than 8 neighbours, the number 9 is not allowed in the rule string. For more information, please read this.
  • --widescreen or -w: Because the characters in a terminal are taller than they are wide, one cell in the game is represented by 2 screen characters. This is so things look more uniformly square. If you would like to have extra horizontal resolution, passing --widescreen will use one character to draw one cell.
  • --edge-wrap or -e: If this flag is enabled, cells will "wrap" around the borders. For example, a glider flying toward into the right border will reappear on the left border (still flying right).
  • --time <num> or -t <num>: This value determines the speed of the simulation in milliseconds. The default value is 250. This value cannot be less than 1.
  • --pause or -p: If this flag is enabled, the game will begin paused (press space to unpause). Useful if you want to examine a pattern at the beginning.

Life 1.05

This program can load files in the Life 1.05 file format. Information about the Life 1.05 file format can be found here.

conway-ncurses's People

Contributors

danielvukelich avatar

Stargazers

Adrian avatar

Watchers

James Cloos avatar  avatar

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.