Code Monkey home page Code Monkey logo

conway.js's Introduction

Conway.js

Conways Game of Life in HTML5/JavaScript

About

Inspiration

This is a curiosity / learning experience project based on some work I did at University; Conway's Game of Life in C++ using the Windows Graphics API. It was a fairly fun project and it allowed me to explorer new topics (mostly cellular automata) that I then went onto use in my Honours Project in the form of Lindenmeyer Systems.

I'm a Games Programmer by education with a background in C++ and C# but work in Test Automation Software with, in particular, web-based software. This essentially meant that from time to time I have to work in web technologies (HTML, JavaScript, etc) and piqued my interest for getting more involved and learning it properly in my spare time and this fit in rather nicely as a 'hello world' project.

Usage

  • Click on the grid to switch a cells state between dead and alive.
  • Click the 'Simulate!' button to start the simulation. Note that the grid cannot be interacted with whilst the simulation is running.
  • Click the 'Stop!' button to stop the simulation and enable interaction.
  • Click the 'Clear!' button to stop the simulation and enable interaction.
  • Select your own choice of 'Dead' and 'Alive' colours using the colour select boxes.

Rules

Like any cellular automata system, Conway's Game of Life uses a set of rules to define how the simulations runs. This simulation uses the following rules:

  • If a cell is alive and has less than 2 neighbours who are also alive, it dies from loneliness.
  • If a cell is alive and has more than 3 neighbours who are also alive, it dies from overcrowding.
  • If a cell is alive and has exactly 2 or 3 neighbours who are also alive, it stays alive.
  • If a cell is dead and has exactly 3 neighbours who are alive, it becomes alive through reproduction.

Written with StackEdit (https://stackedit.io/).

conway.js's People

Contributors

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