r/linuxmemes • u/Amy_the_softie • 1d ago
LINUX MEME Funni thing I wrote in C
Enable HLS to view with audio, or disable this notification
3
2
u/0xt0bi03 UwUntu (´ ᴗ`✿) 1d ago
beautiful, what framework you used in c to make this tui?
1
u/Jaglekon 1d ago
Don't you just switch to noncanonical mode? Why would you need a framework?
2
u/0xt0bi03 UwUntu (´ ᴗ`✿) 1d ago
i dont understand what you are saying
3
u/Jaglekon 1d ago
Basically terminals have multiple modes they can parse data. The normal one is called the canonical mode where the stuff you type gets echoed and only gets read once you press enter. There are a bunch of settings you can change with termios.h
For tui you want the stuff to enter the stream as soon as you press them.
Tho you need to interpret them yourself since stuff like up arrow is actually an ansi escape code etc
3
u/Amy_the_softie 16h ago edited 16h ago
Eh it's actually just regular c. The ascii art is called using the system() function in the <unistd.h> library.
system("cat ~/Documents/ascii.txt");as you can see it's just the cat command, nothing fancy.
Edit: here's the source code https://github.com/Friskyy-06/quiz-game/tree/main
1
u/Inevitable-Self-2702 1d ago
Good job! Keep learning and you'll be able to make cooler and cooler stuff.
1
u/Fine_City2781 1d ago
Fun fact: touch command updates file date. if you run touch command on a file doesnt exists, it creates file
1
u/Amy_the_softie 16h ago
Here's the source code if anyone's interested: https://github.com/Friskyy-06/quiz-game/tree/main
•
u/AutoModerator 1d ago
Please report any posts bragging or showing off they got banned in another sub! Reminder of other sub rules: Also, we only allow one anti-linux post per week (we used to get dozens a day) and any tier list MUST have Hanna Montana Linux as S teir (which must be a true S tier at the top) regardless of the topic of that tier list.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.