GithubHelp home page GithubHelp logo

domgetter / conway_deathmatch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rickhull/conway_deathmatch

0.0 3.0 0.0 131 KB

Conway's Game of Life, with several competing populations

Ruby 100.00%

conway_deathmatch's Introduction

Introduction

Conway's Game of Life is a small, simple set of rules for cellular automata. Operating like a simulation, there is a starting state where certain points on a 2 dimensional board are populated, and the rules of the game determine the next state, generating interesting, unpredictable, and ultimately lifelike patterns over time.

This project was inspired by http://gameoflifetotalwar.com/ (hereafter CGOLTW). You should check it out. It updates the classic set of rules, which support only a single population, for multiple populations which are able to compete for space and population.

This project exists not to compete with CGOLTW but as a supplementary project for exploration and learning. My initial motivation was to make a "proving ground" for searching for simple shapes and patterns with high birth rates for determining successful CGOLTW strategies.

Usage

Install

gem install conway_deathmatch

Demo

# defaults to 70x40 board and an acorn shape
conway_deathmatch

# multiplayer
conway_deathmatch --one="acorn 30 30" --two="die_hard 20 10"

Available Shapes

Definitions

  • acorn
  • beacon
  • beehive
  • blinker
  • block
  • block_engine_count (block engine, minimal point count)
  • block_engine_space (block engine, minimal footprint)
  • block_engine_stripe (block engine, 1 point tall)
  • boat
  • die_hard
  • glider
  • loaf
  • lwss (lightweight spaceship)
  • rpent (R-pentomino)
  • swastika
  • toad

Implementation

Just one file, aside from shape loading. Have a look-see

This implementation focuses on simplicity and ease of understanding. Currently there are no performance optimizations. I would like to use this project to demonstrate the process of optimization, ideally adding optimization on an optional, parallel, or otherwise non-permanent basis -- i.e. maintain the simple, naive implementation for reference and correctness.

Inspiration

Coming into this project, I had significant background knowledge concerning Conway's Game of Life, but I could not have recited the basic rules in any form. After being inspired by competing in CGOLTW, I read their one background page and then the wikipedia page. I deliberately avoided any knowledge of any other implementations, considering this project's implementation as of November 24 (2014) to be the naive, simple approach.

Researched optimizations are now an immediate priority.

Caveats

Boundaries

As currently implemented, this project uses fixed boundaries, and boundary behavior is not standardized to my knowledge. For this project, out of bounds are treated as always-dead and unable-to-be-populated.

Multiplayer

The rules for multiplayer are not standardized. I read about the CGOLTW approach, and this project's approach is similar but different. In CGOLTW, there are always 3 populations, and one population (civilians) is special, in that civilians are born where there is birthright contention. Birthright contention happens when a new cell must be generated, but none of the neighboring parents have a unique plurality. For this project, birthright contention is resolved with a random selection (TODO).

conway_deathmatch's People

Contributors

domgetter avatar rickhull avatar

Watchers

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