All Projects → inishchith → 2048.wasm

inishchith / 2048.wasm

Licence: MIT license
2048 written in C and compiled to WebAssembly

Programming Languages

c
50402 projects - #5 most used programming language
Makefile
30231 projects

2048.wasm

2048 written in C and compiled to WebAssembly

Play

  • Use the arrow keys ( ) to slide the tiles.
  • press n to play over.

Usage

  • 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

But Why?

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).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].