Conway's Distributed Game of Life

➡ Connecting to the network.
-----
-----
-----
-----
-----
📶 Ethereum Network: (determining the network...)
➡️ Send 0.0001 ETH to (working out the contract address...)
(please do not do this on your main-net Ether, only if you are on Rinkeby)

How To Use

This web page shows the output of an implementation of Conway's Game of Life written for the Ethereum network as a Smart Contract. In order to evolve the world to its next state (i.e., go to the next turn) one must simply send at least 0.00001 ETH or more to the smart contract's address on the network. Here are some more details:

  1. Have an Ethereum wallet, ideally as a browser extension like MetaMask (Brave web brower includes a built-in MetaMask).
  2. Create an ETH account with your network set to Rinkeby Test Network
  3. Visit https://faucet.rinkeby.io/ and follow instructions to get funds. For now, it needs link of social media share of ethereum account ID.
  4. Send a transaction of at least 0.00001 ETH, or 10000000000000 Wei to the following address using the Rinkeby Test Network. You can click the address to start a transaction - I recommend a gas limit of at least 400,000.
    Loading...

Explanation

Conway's Game of Life is a cellular automata, and can also be described as a turn-based "zero-player game."

It is made up of a two-dimensional grid of cells. You can think of each cell as having the potential to be populated - it can be alive or dead, and during each turn in the game its state is reassessed based on the states of its 8 neighbours. These are the "rules" by which a cell's state is determined each turn.

  1. Any live cell with fewer than two live neighbours dies, as if 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.

Most implementations of the Game of Life simply have

Who did this?

My name is Dan, I'm a software engineer from the UK who lives in Vancouver, BC in Canada. I have a website where I talk about software, books, and the surprisingly good music that I make, plus a Twitter and a GitHub page.

Why did you do this?

Since 2014 I have been steadily writing implementations of the Game of Life in various languages. It's a fun exercise in TDD and a good way to be exposed to new technologies. The ever-increasing interest in cryptocurrencies and slow rise in availability of distributed apps (Dapps) and smart contracts prompted me to experiment with a version of the game which could run as a Dapp. Turns out, it can.

How did you do this?

I started by completing a Hello World tutorial by Brij Mohan, and then started from scratch with a new project. You can read more in a blog post I wrote (PENDING).

If you'd like to see the code, raise an issue, or open a pull request, you can do so on the GitHub repository.