Producing ascii art via C#

前端 未结 3 1559
渐次进展
渐次进展 2021-01-05 19:13

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# (

相关标签:
3条回答
  • 2021-01-05 19:26

    Have a read at this post http://www.c-sharpcorner.com/UploadFile/dheenu27/ImageToASCIIconverter03022007164455PM/ImageToASCIIconverter.aspx

    It allows you to upload an image which will be converted into ASCII art :) Pretty cool stuff.

    CodeProject has a sample too http://www.codeproject.com/KB/web-image/ascii_art_with_c_.aspx

    0 讨论(0)
  • 2021-01-05 19:31

    To understand the full ASCII "spectrum" one should know about the ASCII Chart, also known as the ASCII Table.

    http://www.asciitable.com/

    Knowing that, one could take code found in the codeproject link and make something "unique" with it. :-)

    If you think about it, it's just a "look-up" table and you can pull a value out of it and do anything you want.

    0 讨论(0)
  • 2021-01-05 19:41

    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!"));
    
    0 讨论(0)
提交回复
热议问题