A version of 2048 built with ncurses as a Computer I final project
The game starts with 2 tiles, each of which can be, randomly, 2 or 4 . If you press any direction, all the blocks will move to this direction the as far as possible, if tiles with the same number get touched while moving, they will be merge into one. Every move add a new tile in a new random position (2 or 4, randomly). The goal is reach up one tile to the 2048 value, you lose if you don't have any possible movement.
gcc
make
ncurses
UTF-8 support
sudo apt-get install libncurses5-dev gcc make
sudo pacman -S make gcc ncurses
yum install gcc make ncurses
git clone https://github.com/edufcarvalho/2048
cd 2048
make || gcc -lncurses -O2 -Wall -ansi -pedantic -Wno-unused-result src/*.c -o 2048
make run
or ./2048
If you have interface issues, it means your OS isn't ready to work with unicode characters, when you run the game, use the the --no--unicode
flag and a simpler interface will appear. Ex.: ./2048 --no-unicode
. If you want to fix it, follow these instructions.
Package managers has some issues with ncurses installing, if the makefile don't be able to access the library (see dependencies) use the command gcc -lncurses -O2 -Wall -ansi -pedantic -Wno-unused-result src/*.c -o 2048
to compile.
Some of the commits and release tags are 100% in brazilian portuguese because the game was made as a college project and we are supposed to code in our maternal language. You can see the original repository clicking here.