kylebanks / conways-gol Goto Github PK
View Code? Open in Web Editor NEWConway's Game of Life implemented with Go and OpenGL.
Home Page: https://kylewbanks.com/blog/tutorial-opengl-with-golang-part-1-hello-opengl
License: MIT License
Conway's Game of Life implemented with Go and OpenGL.
Home Page: https://kylewbanks.com/blog/tutorial-opengl-with-golang-part-1-hello-opengl
License: MIT License
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 in
initOpenGL. 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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.