GithubHelp home page GithubHelp logo

laniman / game-of-life Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 16 KB

Game of Life in vanilla JavaScript

Home Page: https://laniman.github.io/game-of-life/

Makefile 0.16% CSS 11.37% HTML 10.73% JavaScript 77.74%
javascript game-of-life vanilla-javascript

game-of-life's Introduction

Game of Life

image

Overview

This is a simple implementation of Conway's Game of Life, a cellular automaton devised by the mathematician John Conway. The game is played on a grid of cells, each of which can be in one of two states: alive or dead. The game evolves through generations based on a set of rules.

Rules

The rules of the game are as follows:

  • Any live cell with two or three live neighbors lives on to the next generation.
  • Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.
  • All others live cells die in the next generation.
  • Similarly, all others dead cells stay dead.

For more detailed information, refer to the Wikipedia page.

Features

  • The game board is implemented as a torus, where the rightmost cell is a neighbor of the leftmost cell with the same Y coordinate, and the top cell is a neighbor of the bottom cell with the same X coordinate.
  • The size of the game board can be dynamically adjusted through the graphical interface.
  • Initial generation can be generated either by user input using the mouse or randomly.
  • The time taken to generate a new generation is displayed on the screen.

Implementation

The implementation is done using HTML, CSS, and JavaScript without the use of external libraries or frameworks.

game-of-life's People

Contributors

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