Skip to content

An interactive C implementation of Conway's Game of Life with SDL2, featuring dynamic pattern placement and customizable settings.

License

Notifications You must be signed in to change notification settings

AlecInfo/GameOfLife

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Game of Life Logo

Game of Life

DescriptionGetting StartedControlsPatternsProject StructureContributionLicense

Description

The Game of Life is a cellular automaton devised by the British mathematician John Horton Conway in 1970. It's a zero-player game that simulates the life cycle of cells on a grid based on initial configurations.

Getting Started

Prerequisites

  • GCC (GNU Compiler Collection)
  • SDL2 library
    • sudo apt install libsdl2-dev
    • sudo apt install libsdl2-ttf-dev

Compilation

To compile the game, run the provided bash script build.sh:

chmod +x build.sh
./build.sh

The original commande to complie a file is_

gcc -Wall -g -o EXE_NAME FILE_NAME.c -lSDL2

Running the Game

Execute the binary to run the game:

./game_of_life

Controls

Use these keys to interact with the game:

  • h: Spawn a Glider.
  • g: Spawn a Gosper Glider Gun.
  • p: Spawn a Pulsar.
  • m: Spawn a Hammerhead
  • c: Clear the grid.
  • ESC: Quit the game.

Patterns

The game includes various predefined patterns such as Glider and Gosper Glider Gun, which have unique behaviors within the Game of Life.

Project Structure

The project includes source files (src/), headers (inc/), the build script, and this README.

Contribution

Contributions to the Game of Life project are welcome. Feel free to fork, make changes, and submit a pull request.

License

This project is open source and available under the MIT License.

(Back to top)


GitHub @AlecInfo  · 

About

An interactive C implementation of Conway's Game of Life with SDL2, featuring dynamic pattern placement and customizable settings.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published