• Stars
    star
    108
  • Rank 311,081 (Top 7 %)
  • Language
    Go
  • License
    MIT License
  • Created about 7 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Conway's Game of Life implemented with Go and OpenGL.

Conway's Game of Life

conways-gol is a Conway's Game of Life implementation using Go and OpenGL with go-gl, and was developed as part of a tutorial I wrote on OpenGL with Go.

To follow the tutorial and learn OpenGL with Go by implementing Conway's Game of Life for yourself, check out:

Conway's Game of Life

The 'Game'

The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970.

The "game" is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input. One interacts with the Game of Life by creating an initial configuration and observing how it evolves, or, for advanced "players", by creating patterns with particular properties. [1]

The premise of the game is that each cell on the grid is, at any time, either dead or alive. The state of each cell is determined using the following rules:

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

For the full rules, check Wikipedia.

Install

You can download and build directly from source like so:

$ go get github.com/KyleBanks/conways-gol

Usage

$ conways-gol

conways-gol takes a few optional parameters:

-columns and -rows

The -columns and -rows parameters dictate the size of the game board.

$ conways-gol -columns 100 -rows 100

Conways Game of Life 100x100

-seed

Each time conways-gol is launched, it uses a seed value to randomize the state of the game. The -seed parameter allows you to fix that value to replay the exact same simulation. For example, a -seed value of 9000 will always produce an identical game.

$ conways-gol -seed 9000

-threshold

In addition to the -seed, the -threshold is critical in determining the outcome of the game. The -threshold is a percentage, between 0.0 and 1.0 that dictates the chance of each individual cell starting alive or dead. For instance, if the -threshold is 0.15, it means that each cell has a 15% chance of starting the game alive.

$ conways-gol -threshold 0.1

-fps

The -fps flag allows you to configure the frames-per-second of the simulation. If you set -fps to 60, there will be sixty ticks of the game each second.

$ conways-gol -fps 60

Author

conways-gol was developed by Kyle Banks.

License

conways-gol is available under the MIT license.

More Repositories

1

depth

Visualize Go Dependency Trees
Go
873
star
2

goggles

๐Ÿ”ญ Goggles is a cross-platform GUI for your $GOPATH!
Go
671
star
3

XOREncryption

XOR encryption implementations for several languages.
Visual Basic .NET
342
star
4

IconEditText

Reusable view for displaying an ImageView with an EditText for Android 4.0 +
Java
265
star
5

scene-ref-attribute

Unity C# attribute for serializing component and interface references within the scene or prefab during OnValidate.
C#
187
star
6

ReactCalculator

A React Native tutorial where you'll write a calculator app for Android and iOS.
JavaScript
75
star
7

goodreads

Goodreads API client written in Go.
Go
67
star
8

go-kit

A collection of Go utility packages intended to be independent and reusable.
Go
60
star
9

AnimatedListView

An Android ListView implementation that animates views into place, similar to the Google Plus app on Android
Java
49
star
10

shader-pong

HLSL
46
star
11

dockerstats

Monitor Docker container statistics, including memory and CPU usage, from Go!
Go
39
star
12

kylewbanks.com-AndroidApp

An Android app that loads and displays posts from kylewbanks.com
Java
34
star
13

iOS-Enterprise-Distribution-Plist-Generator

Shell
22
star
14

GSONAndroidSample

A simple application that uses the GSON to fetch and parse JSON into Java models for Android
Java
22
star
15

commuter

Commute times on the command line!
Go
20
star
16

AsyncImageDownloader

Very simple asynchronous image downloader for iOS and Mac OS
Objective-C
15
star
17

tensorflow-checkpoints

This repository demonstrates how you could use a simple convolutional neural network classifier to determine game save checkpoints from a video game screenshot.
Python
14
star
18

conways-gol-cnn

A convolutional neural network that plays Conway's Game of Life.
Jupyter Notebook
11
star
19

tensorflow-docker-retrain

Retraining of InceptionV3 or MobileNet using TensorFlow and Docker.
Dockerfile
11
star
20

modoc

modoc is the Master Of Document Organization and Compilation
Go
11
star
21

animated-line-graph-view

๐Ÿ“ˆ An animated line graph view for Android.
Java
9
star
22

s3fs

S3 File Explorer written in Go
Go
9
star
23

unimation

Animation toolbox for Unity 2D and 3D games.
C#
6
star
24

DeployAutoScalingGroup

Shell
6
star
25

awsprof

Manage AWS Access and Secret Key Environment Variables using Profile Names
Go
6
star
26

sql-jekyll-migration

Go
5
star
27

banks-residence

Various home automation related projects.
Go
5
star
28

overlap-shader

5
star
29

react-native-tutorial-reactusers

React Native Tutorial for AnDevCon.com
JavaScript
5
star
30

lambda-uploader

A Node.js module for uploading a source directory to AWS Lambda
JavaScript
4
star
31

Rdio-Controller-for-Leap-Motion

A simple Rdio controller built for the Leap Motion
Objective-C
4
star
32

unity-git-sample

Sample project with Unity
4
star
33

RESTCache

An In-Memory Cache with an HTTP(s) Interface
JavaScript
4
star
34

metroid

A fully managed system for tracking and fetching metrics (Metroids) from AWS DynamoDB.
JavaScript
3
star
35

1rm

A very small command-line tool to calculate your One-Rep Max (1RM).
Go
3
star
36

dockerton

Dockerton wraps the core functionality of Docker into an easy-to-use Node.js library.
JavaScript
3
star
37

thanos

Go
3
star
38

whatsthecodeforthat.com

๐Ÿ’ปReference snippets for common tasks in various programming languages.
HTML
3
star
39

wilks

A Golang implementation of the Wilks Formula for comparing powerlifters across gender and weight class.
Go
3
star
40

hows-the-market

๐Ÿ“ˆ Checking in on the market from your command line.
Go
3
star
41

readme

A command-line tool to fetch and display a projects README.
Go
2
star
42

unity-shader-graph-sprite-effects

C#
2
star
43

DartCalculator

A basic calculator built using Dart
Dart
2
star
44

go-yf

A small wrapper around the Yahoo Finance v8 API written in Go.
Go
2
star
45

GSONVolleyTutorial

Java
2
star
46

btn

Objective-C
1
star
47

unity2d-custom-gravity

Custom Global Gravity in Unity
C#
1
star
48

udacity-ml-engineer-nanodegree

Jupyter Notebook
1
star
49

linguist

A command-line tool to practise translating sentences
Go
1
star
50

kurz

Go
1
star
51

make

Various Makefile Templates
Makefile
1
star