Sven Hendriks is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

shendriks / conway

jQuery plugin for simulating Conway's Game of Life

Clone this repository (size: 7.4 KB): HTTPS / SSH
hg clone https://bitbucket.org/shendriks/conway
hg clone ssh://hg@bitbucket.org/shendriks/conway

conway overview

Recent commits See more »

Author Revision Comments Message Labels Date
Sven Hendriks 832ca35e96a3 Updated README file.
Sven Hendriks 215bfb8f72ed Added tag 0.0.2b for changeset dd59cd6cf66f
Branch
production
Sven Hendriks dd59cd6cf66f Merged default head into production.
Tag
0.0.2b
Branch
production
Sven Hendriks c45680ef5ed8 Added small demo.
Sven Hendriks 9258de2acf50 Added tag 0.0.1b for changeset 84bb32582ea0
Branch
production

jQuery conway plugin

Author and license

Copyright (c) 2011, Sven Hendriks (hendriks.sven@googlemail.com) Licensed under the GPL Version 2 license.

Overview

This piece of code implements Conway's Game of Life as a jQuery plugin.

It supports separate layers of activity, each one simulating its own conway universe. Different layers use different colors. The colors of overlapping active cells from different layers are mixed for your viewing pleasure.

Dependencies

This code relies on the jQuery xcolor plugin. This can be found here: http://www.xarg.org/project/jquery-color-plugin-xcolor/

Usage

  1. You need to define a div element like so:
<div id="letsrock"></div>
  1. Then call the conway plugin:
<script type="text/javascript">
    $(document).ready(function() {
        $('#letsrock').conway({
            rows: 8,
            cols: 16
        });
        $('#letsrock').conway('start');
    });
</script>