Hexdraw by George2k

\xef\xbb\xbfusing System;\x0d
using System.Collections.Generic;\x0d
using System.Text;\x0d
\x0d
class Program\x0d
{\x0d
    static void Main()\x0d
    {\x0d
        string input = Console.ReadLine();\x0d
        StringBuilder output = new StringBuilder();\x0d
        List<byte> bytes = new List<byte>();\x0d
        for (int i = 0; i < input.Length; i++)\x0d
        {\x0d
            if (i % 2 == 0)\x0d
            {\x0d
                bytes.Add(Convert.ToByte(input.Substring(i, 2), 16));\x0d
            }\x0d
        }\x0d
        foreach (byte b in bytes)\x0d
        {\x0d
            for (int i = 0; i < 8; i++ )\x0d
            {\x0d
                if (i % 2 == 0)\x0d
                {\x0d
                    output.AppendFormat("<{0}>", Convert.ToString(b, 2).PadLeft(8, '0').Substring(i, 2));\x0d
                }\x0d
            }\x0d
        }\x0d
        output.Replace("<00>", " ").Replace("<01>", ".").Replace("<10>", "#").Replace("<11>", Environment.NewLine);\x0d
        Console.Write(output.ToString());\x0d
    }\x0d
}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page