tiehuis / 2048-cli Goto Github PK
View Code? Open in Web Editor NEWThe game 2048 for your Linux terminal (https://github.com/gabrielecirulli/2048)
License: MIT License
The game 2048 for your Linux terminal (https://github.com/gabrielecirulli/2048)
License: MIT License
This behavior is not consistent with the original game. This makes the game much easier because players are not forced to move numbers every turn.
Line 29 in c065ab4
This may lead to de-referencing null.
It seems colors only are available for VT100 terminals. I'm using a tmux-256color
terminal when I'm running tmux and outside of tmux, the terminal is xterm-256color
.
I'm trying to think of where I've seen the use of 256 colors or at least 16 colors in C/C++ programming before, because I know it applies to more than just VT100 terminals.
Support needs to be extended for other terminals.
When I tried to build on Ubuntu, it gave me some errors like Fatal error: can't create obj/ai.o: No such file or directory
which I created obj directory manually to fix it. And I also had to install some dev package to fix some missing headers via sudo apt-get install libsdl2-dev libncurses5-dev libsdl2-ttf-dev
.
Hope the author update the documentation to support ubuntu/debian distribution.
Since I figure this would be a simple enough game to run on a Raspberry Pi 3, I downloaded it to my Pi to try it out.
However, I encountered a couple of errors that need fixing.
$ make
cc -Wno-visibility -Wno-incompatible-pointer-types -Wall -Wextra -DINVERT_COLORS -DVT100 -O2 src/ai.c src/options.c src/main.c src/highscore.c src/engine.c src/merge_std.c src/gfx_terminal.c -o 2048
src/gfx_terminal.c: In function ‘gfx_draw’:
src/gfx_terminal.c:59:28: warning: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 3 has type ‘long int’ [-Wformat=]
printf("%*zd |", g->print_width, merge_value(g->grid[x][y]));
^
src/gfx_terminal.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-visibility’
The first item is that typo on line 59 of gfx_terminal.c
. Get rid of that z
in that 'printf' statement.
The second item is that I've checked with just about every compiler (well, at least GCC and Clang documentation) and there is no such warning as -Wno-visibility
. So you can drop that argument.
I'm going to try to make these corrections myself to see if that fixes everything.
I have curses installed and it works fine with other command line programs, yet 2048 -c
does not add color.
How do I run this from terminal?
There is a typo. It has to be "i18n".
From wiki:
The terms are frequently abbreviated to the numeronyms i18n (where 18 stands for the number of letters between the first i and the last n in the word internationalization
Hello!
I'm planning to package this for Fedora and EPEL. Could you please tag a versioned release and keep that updated, when merging new features / improvements?
Cheers,
Björn
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.