2048 written in C and compiled to WebAssembly
- Use the arrow keys ( ᐊ ᐅ ᐃ ᐁ ) to slide the tiles.
- press n to play over.
- Compile C code
$ cd src
$ make game
$ ./play
Note: Make sure you add the appropriate path to SDL2 headers and libs under Makefile.
- Compile C code to WASM via emscripten
$ emcc -s WASM=1 -s USE_SDL=2 -s USE_SDL_TTF=2 --preload-file src/Nunito-ExtraBold.ttf -O3 -I include -L lib src/main.c -o docs/2048.js
why not? Took this up as an experiment; This is just 300 lines of really poor C code which took forever to compile to wasm (rip sdl font).