Skip to content

MarcelKaemper/GameOfLife

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GameOfLife

On first launch, you'll be in edit mode. Create your pattern using mouse clicks, then press spacebar to run the game. You can always change the mode using spacebar.
I safe the status of each cell in a 100x100 array. The changes are stored in a second array. After every cell has been processed, array 2 will be copied into array 1. This solution sucks very bad and I'll probably change it later, but it works for now.

Compilation

Using gcc:

gcc -lGL -lglut -lm main.c

Math

The formulas I developed to find either the index of the element when x and y coordinates are given or the x and y coordinates when the index is given.

max = max amount of elements in a row
x,y = coordinates

Index by gridpos

Gridpos by index:

Releases

No releases published

Packages

No packages published

Languages