ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am writing a simple text-based fighting game and I would like to know how to change the color of the text to be printed to the screen.
I am not using SDL, SVGA-LIB, GTK,ALLEGRO or any of those libraries.
I would like to know if it is possible to change the color of text for CLI only.
Without using any graphics libraries.
I will try the ncurses/curses library but.... Is there a way to do it and the program still be portable to Dos?( I know.. I know this is a Linux site.. but I would like to port to Dos... NOT WINDOWS!)
What I'm asking is... is there a way to write the program and display different colors and have the same program able to compile under Dos?
i dont think curses is available for dos, the only thing i can think of is to write a class that abstracts curses from your actual program and and then write a dos implementation of the same calls, so your code is the same but you have a class that makes the appropriate calls depending on operating system.
THANKS! Angelo! That help so much .. .
I was just sick and tired of writing boring grey on black programs... but now....
Anyway thanks for the help everyone.
P.S.
After I'm finished version 0.8beta of the game then I'll post the link to it okay?
And anybody who helped me with this problem can download a copy.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.