Skip to content

iximiuz/golife.c

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
web
 
 
 
 
 
 

The Game of Life

Yet another implementation of Conway's Game of Life. This time in C with SDL2.

Compilation to WebAssembly and asm.js via emscripten is also supported.

Play on iximiuz.com/golife.

# install SDL2 first (eg. brew install sdl2)
cc -O3 -lsdl2 -I/usr/local/Cellar/sdl2/2.0.8/include/SDL2/ src/*.c -o life
# ./life

# install emsdk first (see emsdk project)
emcc -O3 -s WASM=1 -s USE_SDL=2 -I/usr/local/Cellar/sdl2/2.0.8/include/SDL2/ src/*.c -o web/life.wasm -o web/life.js
# cd web; python ./server.py and open browser on http://localhost:8000/index.html