Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including gof-gpu with all npm packages installed. Try it out:

var gofGpu = require("gof-gpu")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

gof-gpu v1.0.4

game of life algorithm module from Stack-GL

Conway's Game of Life Browserify module GPU

npm version

Install

$ npm install gof-gpu --save-dev

Usage

var GoL = require('gof-gpu');
var world = new GoL(howManyBlocks, speed); // speed:int
world.restart()

function update()
{
    var grid = world.update();
    // +=4 as you just need the first value of the GoL 255 or 0
    for (var i = 0; i < grid.length; i+=4) {
        var line = grid[i];
        // line[a] element true/false
    }
    
    requestAnimationFrame(update);
}

image

Live Demo

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free