/ESP32-Game_of_life

ESP-WROOM-32-38pin ST7789 240x240px Display

Primary LanguageC

🎮 ESP-WROOM-32-38pin ST7789 240x240px Display

Game_of_life (5)

GitHub code size in bytes Static Badge Static Badge Static Badge GitHub top language GitHub commit activity (branch)

Game of Life simulator with variable rules and random map generation

Features

  • Easy rule modification

  • Portable for many TFT displays such as ILI9341

  • Randomly generated maps so you are only changing rules

Video

Watch the video

Try other games and create your own

  • Game of life : R1/B3/S2-3
  • Blob life: R4/B24-33/S10-33
  • Coral: R1/B3/S45678
  • Larger than life: R5/B34-45/S33-57

Example settings for "Larger than life"

* neighbors_min     33 - minimal neighbors cout to survive 
* neighbors_max     57 - maximal neighbors cout to survive
* neighbors_to_spawn_min 34 - count of neighbors to spawn new pixel
* neighbors_to_spawn_max 45 - count of neighbors to spawn new pixel
* Spawn_probability 40 - probability in[%] to spawn in first iterration 
* neighbors_range   5 - range of neighbors around

N - neighbor                         N N N N N
C - cell                             N N N N N
             N N N                   N N C N N
             N C N                   N N N N N
             N N N <- range = 1      N N N N N <- range = 2

Porting

If you want to display "Game of life" on other display or use diffrent uC you have to change those functions for yours carbon

And change those defines to fit your hardware

carbon (6)

examples below--->

Display init

carbon (1)

Intro

carbon (2)

Display pixel

Here put your display function to draw a pixel .In display_pixel_Dead color should be color of your background carbon (3)

Random Number Generation

For creating random map you need to define your uC RNG function .Function have to return random number form 0 to 99

carbon (5)

Project use :