game-of-life-go

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2018 License: MIT Imports: 11 Imported by: 0

README

game-of-life-go

An adaptation of Conway's Game of Life created with Go for a hackathon at work.

Installation

go get -u github.com/eleniums/game-of-life-go
dep ensure

Run

go run main.go

Prerequisites

  • Requires Go 1.8 or later
  • Uses dep for dependencies
  • Uses pixel for graphics and input

Explanation

Conway's Game of Life is a zero player game, meaning the player sets an initial state and then sits back as the simulation is run. The simulation consists of a grid of cells that exist in one of two states, alive or dead. These cells are governed by 4 rules, based on the 8 neighboring cells surrounding any given cell:

  • If there are less than 2 living cells surrounding a living cell, it will die, as if by underpopulation.
  • If there are 2 or 3 living cells surrounding a living cell, it will continue to live.
  • If there are more than 3 living cells surrounding a living cell, it will die, as if by overpopulation.
  • If there are exactly 3 living cells surrounding a dead cell, it will become alive, as if by reproduction.

This leads to many interesting patterns and is fascinating to mess around with. Interestingly enough, it is also Turing complete, meaning it can simulate a computer. The Game of Life itself has been built with the Game of Life!

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL