Giter Club home page Giter Club logo

game-of-life's Introduction

game-of-life

Conway's Game of Life in Terminal!

glider_gun

Features:

  • play/pause

  • 4 level speed adjustment.

  • Saving curent pattern to a text file.

  • Loading a patten from a text file.

  • Live edit mode.

Prerequisites

  1. install git & c/c++ compiler
$ sudo apt install git build-essential
  1. install ncurses
$ sudo apt install libncurses5-dev libncursesw5-dev
  1. clone the repo
$ git clone https://github.com/saurabhsingh99100/game-of-life.git
  1. cd to the cloned repo & compile the program using the povided shell script
$ cd game-of-life
$ ./compile.sh

Note: You may first need to make compile script executable, this can be done by:

$ chmod +x compile.sh

Instructions

  • play/pause at any time using the p key.

  • quit at any time using q key or ctl+c.

  • Use 1, 2, 3, 4 keys to adjust speed in an inceasing fashion.

  • To save currently displayed pattern, press s key. Then enter a filename in the prompt that will appear on the top of the scrreen & press enter. (Use - key for backspace).

  • To load a pattern from a file, invoke the program with filename as a command line argument. ex $ ./gol patterns/glider_gun.

  • To edit the current pattern:

    • pause the simulation (using p key) & a cursor will appear (marked by symbol O).

    • You can move the cursor up, down, left, and right using i, k, j, l keys respectively.

    • To toggle the state of a cell (from alive to dead or vice-versa), move the cursor to that cell and use space key.

Have Fun!

game-of-life's People

Contributors

saursin avatar

Watchers

 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.