Welcome the game of life client implementation

This app is built with react and remix.

This is the client implementation of the game, game of life

simultion

Prerequisites

node.js at least version 14 installed

services used by this app is defined here: game-of-life-service, follow the guide there to set up the service.

Run app locally

clone this repo

Install remix

npm install remix

When you have the game-of-life service running you can start this app in development mode by running this from your terminal when standning at root folder of this repo.

npm run dev

Head to a browser and type in

localhost:3000

You can choose which cells that you want to start with by clicking on them och then you start by clicking the start button. You can stop the game by clicking the stop button.

Game of life rules (from Wikipedia)

The universe of the Game of Life is an infinite, two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, live or dead (or populated and unpopulated, respectively). Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur:

  • Any live cell with fewer than two live neighbours dies, as if by underpopulation.
  • Any live cell with two or three live neighbours lives on to the next generation.
  • Any live cell with more than three live neighbours dies, as if by overpopulation.
  • Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.

Improvements ideas for future

  • Be able to unclick buttons that are clicked
  • Be able to clear the board
  • Stop simulation when there are no active cells
  • Make more use of remix framework instead of react as of today
  • Move restcall to an own component
  • Fix better state handling