Git Product home page Git Product logo

multilife's Introduction

MultiLife
Joel Murphy & Ba Nguyen

Copyright (C) 2009 Joel Murphy & Ba Nguyen
All rights reserved

Multilife is licensed under the GNU General Public License, version 2. The
text of this license can be found in gpl-2.0.txt. Distribution of this this 
software requires this paragraph to remain intact, and the gpl2.txt file to 
be included in the same directory folder as this README file.

Introduction
============
MultiLife is a "zero-player" simulation based on Conway's Game of Life
(Life). In MultiLife, the user uses a play field to create an initial
condition (generation 0) and an algorithm iteratively generates all future
generations. This multi-species variant allows for different types of life.
A type of life is defined as a particular set of rules governing
generational growth patterns.

Background
==========
Life's algorithm is rather simple. A rectangular array of "cells" are either
on (populated) or off (vacant). A turn-based algorithm examines each
previous "generation" and computes the current generation based on that
information. Unpopulated cells become populated when exactly three adjacent
cells were populated. Populated cells become unpopulated when the count of
adjacent cells is less than two or greater than three.

The algorithm of Life, which we will call the "base algorithm," is as
follows:

    define field           // array of cells
    define cell            // current cell
    define cell.populated  // true if "on"
    define cell.adjacent   // ..... Count of the 'a' cells that are 
                           // .aaa. populated surrounding 'C'. Cells that 
                           // .aCa. do not exist (are on the border of the 
                           // .aaa. field) are considered unpopulated.
                           // .....

    do
      foreach cell in field
        if cell.populated = true
          if cell.adjacent < 2 or cell.adjacent > 3
            cell.populated = false
          fi
        else
          if cell.adjacent = 3
            cell.populated = true
          fi
        fi
      rof
    od // endless loop

MultiLife
=========
This project differs from Life by adding different algorithms to determine
if a cell is populated, allowing for multiply types of "being." Each being
type would have its own rules for generation and survival. For example, one
type could check a cross pattern for survival while another could check an X
pattern:

    ..a.. a...a
    ..a.. .a.a.
    aaCaa ..C..
    ..a.. .a.a.
    ..a.. a...a

Being types will be organized by lists according to their type, the head of
each list being a double pointer, also referencing the next type of being. 
This has the effect of introducing a priority system to the list of life 
types, causing the tail of the type list to have highest priority ("nice 
guys finish last").

A fairly significant change to the base algorithm will be necessary to
accomodate multible being types. To handle this, the algorithm will traverse
a given being type, marking the cells it affects and is affected by. These
marks are tallied, compared to the cell population, and the next generation
is created from this data.

multilife's People

Contributors

ban avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

multilife's Issues

Influences Update

Add code to update influences whenever observeCheckGroup is modified. A function within Life.cpp should be added to recalculate all influences.

Example code can be found in the populateCell and unpopulateCell functions.

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.