Thursday, September 8, 2016

Coloring Terminal Text with ANSI Escape Sequences

If you have ever wondered how to print colored text to the command line, this is the post for you!

Pretty much all newer computers (including Windows 10 and above) allow for the use of ANSI escape sequences. ANSI escape codes are a holdover from the 1980's, but no one has come up with a better standardized way of modifying command line output, so they've stuck around long enough that even Windows has incorporated them. (Anyone, who is old enough to have dealt with IE6 gets that joke.)

Try typing the following into a terminal window.

printf "I'm \033[0;31mRED\033[0m"

Monday, September 5, 2016

Light for Rooms and Areas in CoffeeMud

Once you get CoffeeMud up and running, you're going to notice that during the game's night (hour 5) you can't see anything. Even as the Archon, you can't see anything. The easy solution as an archon is to type:

cast light

That makes it so you, as the CoffeeMud Archon can see. This, however, does not make life easier for your potential players. Imagine a first time player of MUD's logging in and all it says is, "You can't see anything." That's a horrible user experience for the first time player, and you can assume that it is the last time they will log into your MUD.