mevdschee / 2048.c Goto Github PK
View Code? Open in Web Editor NEWConsole version of the game "2048" for GNU/Linux
License: MIT License
Console version of the game "2048" for GNU/Linux
License: MIT License
The current version of 2048.c(not my fork) was compiled with clang
and works fine under FreeBSD.
You may mention this in README.md
Hi, I compiled 2048.c with both gcc and clang on an i386(the architecture) which was running OpenBSD and easily played it.
P.S.: I think it can be easily compiled and ran on most Unix-like operating systems including GNU/Linux, BSDs and Mac.
This would require saving the highest score with date and time in a file. When the game ends, the high score should be shown, with a special message if the current score breaks previous high score.
gcc -o 2048 2048.c
2048.c:37:2: error: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned long, const char *, ...)' [-Werror,-Wimplicit-function-declaration]
snprintf(color,length,"\033[38;5;%d;48;5;%dm",*foreground,*background);
^
2048.c:37:2: note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf'
1 error generated.
I got this error when I was trying to run it on a virtual machine, is it any solution for it?
· · · ·
4 · · 2
· · · ·
· · · ·
←,↑,→,↓ or q
Error! Cannot read keyboard input!
$>
I asked this question in another issue but I think it's better to open a new one for it.
Should any bug fix or feature add work fine under FreeBSD as the current version does or GNU/Linux is enough?
Hi Maurits,
Just noticed some strings in README_es have been translated not very accurately (some online translator perhaps? 😄).
In Debian package I've applied this patch to fix it:
https://salsa.debian.org/games-team/2048/-/blob/master/debian/patches/readme_es.patch
Would be nice to apply it to yours.
Thanks in advance!
1
Hi Maurits,
First, thanks for your game ;-) I like text games and yours is nice one. While packaging it for Debian I've added a desktop file and icon. It's recommended that desktop files to be distributed upstream, so others don't have to do the same work again, so feel free to add them to your git (license is also MIT, as stated on copyright file). Files are available from packaging git:
https://salsa.debian.org/games-team/2048/-/tree/master/debian
best regards and happy new year!
I can't understand the ascii about left arrow, right arrow, up arrow and down arrow .
I just know letter D is 68,what about left arrow?
👋 I wonder if you can help tag the release so that the downstream package manager (like homebrew) can pick up the new changes. Thanks!
relates to Homebrew/homebrew-core#130360
cc @mevdschee
You may want to add the following topics:
2048
2048-game
2048-clone
And anything which you think is fine.
It work fine on OS X, you can remove the GNU/LINUX and replace it by UNIX (maybe it's up to you)
😄
when dealing with higher numbers it becomes a problem so it's better to use a-z mode
Add command line help by identifying flags --help
or -h
. All CLI tools have these arguments, so it's a bit strange that 2048
doesn't.
I ran into this by accidentally running 2048 from dmenu, which essentially does this.
You can do this in a terminal and the game appears to start normally, but it doesn't accept key input and it uses 100% CPU.
You should move ?=
to +=
in CFLAGS delete the 2048: 2048.c
so that make
uses the implicit rule. It would use CFLAGS and LDFLAGS from the environment. It's useful for package building.
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.