Skip to content

inishchith/2048.wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

2048 written in C and compiled to WebAssembly

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published