gnikdroy / 0x2048 Goto Github PK
View Code? Open in Web Editor NEWA yet another implementation of the game 2048 in C!
License: MIT License
A yet another implementation of the game 2048 in C!
License: MIT License
It works with 3.5 for me.
The system /usr/share/fonts/truetype/ubuntu-font-family/UbuntuMono-R.ttf
file isn't seen by the app.
Plus, I had to patch the source to (1) find what is missing and (2) put apart two different conditions:
diff --git a/src/game.c b/src/game.c
index fff56ee..97adefd 100644
--- a/src/game.c
+++ b/src/game.c
@@ -76,7 +76,7 @@ void display_text(SDL_Renderer* renderer,const char* text,int size)
font= TTF_OpenFont(FONT_PATH, size);
if(font==NULL)
{
- fprintf(stderr,"The required font was not found");
+ fprintf(stderr,"The required font was not found at %s (1)", FONT_PATH);
exit(EXIT_FAILURE);
}
SDL_Color black = {g_fg.r,g_fg.g, g_fg.b};
@@ -200,7 +200,7 @@ void game_loop(Board board,SDL_Renderer* renderer)
font= TTF_OpenFont(FONT_PATH, CELL_FONT_SIZE);
if(font==NULL)
{
- fprintf(stderr,"The required font was not found");
+ fprintf(stderr,"The required font was not found at %s (2)", FONT_PATH);
exit(EXIT_FAILURE);
}
to get
jno@shuttle:~/src/0x2048/build$ bin/2048
The required font was not found at UbuntuMono-R.ttf (1)jno@shuttle:~/src/0x2048/build$
jno@shuttle:~/src/0x2048/build$
(missed newline left as it was)
Or it works only when started from its bin/
folder...
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.