How to make you console app look cool

From time to time everyone needs to write simple console application. It’s a great, simple type of project to test something or write a simple tool. However, most of the times it looks… kind of dull. This is a part of a series of articles about writing a perfect console application in .net core 2. Feel free to read more:

What if it could have an updating percentage value?

Let’s start with something we know. Let’s create a console app, that would show a percentage of the task being done. And it produces output like this: There’s one little trick to it. Notice I used \r character, that moves caret back to the beginning of the line, where next write overrides last one. It’s a simple animation!

Let’s create a spinner

With a bit of searching through Internet and a little of code: We will have something like this:

We need to go bigger!

I searched a bit and came across this post on StackOverflow: Here it is an implementation of an “executive desk toy”. And we have multiline ASCII animation: Cool, isn’t it? With your imagination and thousands of Unicode characters possibilities are limitless.

Let’s have some color

Colorful.Console is a fantastic nuget package, that you can use to introduce some color into your console application. With just a few lines of code: We can see something like this: Colorful.Console overrides original console, so it does have all existing methods, but it extends original object with new possibilities. This is important, because you can start using this console in your old code, but introduce color only where you want it. So let’s do some animation with color. This is super easy and a lot of fun. This code produces simple, but effective animation. How would it look in your next console tool? Awesome! This nuget package offers even more, like colorful text. You can use ASCII fonts to write text. You can download fonts here – there are plenty. With a little code: And downloaded larry3d.flf font file you can see an effect: Full tutorial is available here: All code posted here is available on my github repository: Enjoy and make exciting and amusing code 🙂

4 thoughts on “How to make you console app look cool

  1. I have a question, is there a way to stop the looping animation? I tried to make a looping animation for the title screen of a game I am making on C# and I can’t figure out how to end the loop to proceed to the next step of the game. Is there any way to do so? Thanks!

    1. Hi Troy,
      I think you can add a condition to a for loop. Instead of having only ‘i < 50' you can have 'i < 50 && continueAnimation', where continueAnimation would be a boolean variable. However, for that to work, you would have to have an animation in a different thread. Threading is probably a must-have in game development, but it can be cumbersome at first.

Leave a Reply

Your email address will not be published. Required fields are marked *