Giter Club home page Giter Club logo

game-of-life's Introduction

game-of-life

An implementation of Conway's Game of Life

Submission for HackYSU 2021

How to Use

When you launch the application, you will see two numbers at the top, and and many red pixels.

The numbers represent the Viewport position (it is the coordinate of the cell in the top left corner).

The box of pixels (cells) at the bottom represent the cells in the Game of Life. Clicking a cell will turn it green. Green cells represent "living" cells, and red cells represent "dead" cells. Living and dead cells will change over time, following the rules of Conway's Game of Life:

  1. Any live cell with two or three live neighbours survives.
  2. Any dead cell with three live neighbours becomes a live cell.
  3. All other live cells die in the next generation. Similarly, all other dead cells stay dead.

Pressing ENTER will move the cells to the next state. Pressing SPACE will automatically move the cells to the next state every frame. Using the Arrow Keys will move the viewport.

If you click a cell, it will toggle from dead to alive. This way, you can set the live tiles at runtime to play with it. If you give a file as a commandline argument, that will be used as the initial state. The file must be formatted with: 2 numbers representing the width and height of the game board, followed by (width * height) characters, either 0 or 1 representing dead or alive. See testfile.txt for an example.

Without an argument, the board will be 1000 by 1000.

Acknowledgements

Using olcPixelGameEngine

game-of-life's People

Contributors

rayquaza01 avatar

Watchers

 avatar  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.