I've noticed that certain programs that run within the command line can present text in multiple colors at once. How can I use this functionality?
Google ansi color codes
I was hoping I could do this in a Windows batch script, but using it from within C is still neat. Thanks.
>>3
You still can
>>3 You can. You simply need an editor that lets you enter ^[
>>5
And Notepad can... Alt-27? (I'm not on Windows at the moment, though, so can't verify. Might be Alt-027.)
EDIT.COM can too, which I recommend if you're going for the true oldschool experience. Also, do it all in fullscreen mode, so you can learn the way old farts like myself did: quitting and restarting the editor to do every test. It's fantastically tedious.
And if that's not enough for you, run it off of an 5ΒΌ" floppy.
How do I do this in C? I've found instructions on configuring COMMAND.COM so that batch files can play with the colors, but I know when I use a program compiled in C and it displays multiple colors, nothing's been done to my computer's configuration. I just compiled a program that printf's the string "\033[0;40;32m;Hello World!\n" and it showed up in black and white.
Run ansi.com first.
MS-DOS used to come with it, and there were various alternate ANSI implementations as well.
> quitting and restarting the editor to do every test. It's fantastically tedious.
i never understood why they took that feature out when they turned the qbasic ide into a text editor.