Code Monkey home page Code Monkey logo

conways-gol's People

Contributors

kylebanks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

conways-gol's Issues

give colour depending on state

Hi,

First off, I wanted to thank you, I was looking for such template for about a year, was doing it in python but it was too slow. I actually modified your program to do something different bu I needed to render squares from a matrix in a heatmap like graph.

Anyway, my question is how would you go and define a colour depending on the state of the cell. I see that the colour is defined in fragmentShaderSourcewhich is used ininitOpenGL. So I don t really see how one could change this when draw` is called.

Thanks in advance.

ps: I know this repo is old, but I saw your activity a few days ago on another of your repo. Even if you don't exactly remember how this game of life is implemented, I'm just looking for a direction, not an already made solution, although that would be good too

Problem with the implementation of the game.

There is a problem with the rules of life implemented here.

I experimented with setting up initial patterns, and they are not evolving as expected.

For example, creating three cells

 cell[5][5].alive, cell[5][5].nextState = true, true
 cell[5][6].alive, cell[5][6].nextState = true, true
 cell[5][7].alive, cell[5][7].nextState = true,true

(and all other cells turned off) should create a "blinker" that has a period 2 oscillation

                    *               
    ***   ->        *       ->    * * *
                    *

I also could not create a "glider".

I suspect there is a mistake with the lines

c.alive = c.nextState
c.nextState = c.alive

It is changing the alive/dead state of the cells at the same time as it is reading them to decide which cells live and which die.

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.