Producing ascii art via C#

GurdeepS picture GurdeepS · Aug 8, 2010 · Viewed 22.8k times · Source

I once did a programming test for a job, which involved producing ASCii art in C#. I didn't really do well at this, as I had little idea or experience of doing this in C# (or in any programming knowledge).

Are there any resources or classes in .NET that would be worth knowing/practising on?

Answer

Drew Noakes picture Drew Noakes · Oct 17, 2017

ASCII art is pretty general, but if you want to produce an ASCII banner or heading then I've ported the popular FIGlet font generation to .NET:

https://github.com/drewnoakes/figgle

It's very easy to use, and available on NuGet for almost every version of .NET (netstandard1.3 and above, so .NET Framework as well as .NET Core, Xamarin, etc...).

            _ _          __    __           _     _   _ 
  /\  /\___| | | ___    / / /\ \ \___  _ __| | __| | / \
 / /_/ / _ \ | |/ _ \   \ \/  \/ / _ \| '__| |/ _` |/  /
/ __  /  __/ | | (_) |   \  /\  / (_) | |  | | (_| /\_/ 
\/ /_/ \___|_|_|\___( )   \/  \/ \___/|_|  |_|\__,_\/   
                    |/       

Produced via:

Console.WriteLine( 
    FiggleFonts.Ogre.Render("Hello, World!"));