Git Product home page Git Product logo

game-of-life's Introduction

Conway's Game of Life

This is a Next.js app built as a React-based front-end application that simulates Conway's Game of Life. It is a cellular automoton created by British mathmetician John Horton Conway in 1970. This project replicates an interactive implementation of the game that allows users to explore the patterns that emerge based on the initial input state.

Purpose

This application allows me to demonstrate my ability to build a React application from scratch. The application is built with the following technologies:

  • React: A JavaScript library for building user interfaces.
  • Next.js: A React framework for building server-side rendered and statically generated applications.
  • Redux Toolkit: The official library for Redux stores.
  • React Redux: The official React bindings for Redux.
  • Redux Thunk: A middleware for Redux that allows asynchronous logic to be dispatched.
  • Three.js Light-weight, cross-browser, general purpose 3D library that uses a WebGL renderer.
  • React Three Fiber Self contained, reusable React components for three.js.
  • Mantine UI: A React UI component library.

Getting Started

Prerequisites

Before starting ensure that you have the following:

Installing

To install the application, follow these steps:

  1. Open a terminal and navigate to the root directory of the repository.
  2. Run npm install to install the dependencies.
  3. Run npm start to start the application.
  4. Open a browser and navigate to http://localhost:3000.
  5. Update directions to get the server db running locally.

Features

The application includes the following features:

  • Panning using click and drag and zooming using the scroll wheel.
  • Erasing from the board to remove live cells.
  • Drawing on the board to create live cells.
  • The ability to advance to the next state of the game.
  • An option to continuously play the game, automatically advancing states.
  • The ability to advance a specified number of states at once.

Additional features include:

  • The option to toggle a toroidal board structure, where the edges of the board wrap around to the other side.
  • Adjustable speed for automatic playthroughs.
  • Adjustable board size.
  • The ability to set the color of live cells, dead cells and the boards background.
  • The ability to reset or clear the board.
  • A counter tracking the number of generations since the board was created.
  • The ability to save and load the board state from an API.
  • Best performing algorithm that processes live cells and their neighbors for mutations.
  • Using Canvas element with three.js to render the board.

Backend API

The application is backed by a web server integrated into Next.js. The API uses a TBD database and provides endpoints to save and load a board. The API is called from a Redux thunk.

game-of-life's People

Contributors

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