SHARE
TWEET

ASCII

g-stoyanov Mar 11th, 2014 640 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Exercise12JustAscii
  2. {
  3.         using System;
  4.  
  5.     static void Main()
  6.     {
  7.         Console.Title = "Just Another ASCII Table";
  8.         Console.SetWindowSize(42, 50);
  9.         Console.WriteLine("\u250c" + new string('\u2500', 10) + "\u252c" + new string('\u2500', 5) + "\u252c" + new string('\u2500', 5) + "\u252c" + new string('\u2500', 5) + "\u252c" + new string('\u2500', 9) + "\u2510");
  10.         Console.WriteLine("\u2502   BIN    \u2502 OCT \u2502 DEC \u2502 HEX \u2502  ASCII  \u2502");
  11.         Console.WriteLine("\u251c" + new string('\u2500', 10) + "\u253c" + new string('\u2500', 5) + "\u253c" + new string('\u2500', 5) + "\u253c" + new string('\u2500', 5) + "\u253c" + new string('\u2500', 9) + "\u2524");
  12.         for (int i = 0; i < 32; i++)
  13.         {
  14.             Console.WriteLine("\u2502 " + Convert.ToString(i, 2).PadLeft(8, '0') + " \u2502 " + Convert.ToString(i, 8).PadRight(3, ' ') + " \u2502 " + i.ToString().PadRight(3, ' ') + " \u2502 " + Convert.ToString(i, 16).PadRight(3, ' ') + " \u2502 " + "control".PadRight(7, ' ') + " \u2502");
  15.         }
  16.         for (int i = 32; i < 127; i++)
  17.         {
  18.             string output = ((char)i).ToString();
  19.             Console.WriteLine("\u2502 " + Convert.ToString(i, 2).PadLeft(8, '0') + " \u2502 " + Convert.ToString(i, 8).PadRight(3, ' ') + " \u2502 " + i.ToString().PadRight(3, ' ') + " \u2502 " + Convert.ToString(i, 16).PadRight(3, ' ') + " \u2502 " + output.PadRight(7, ' ') + " \u2502");
  20.         }
  21.         Console.WriteLine("\u2502 " + Convert.ToString(127, 2).PadLeft(8, '0') + " \u2502 " + Convert.ToString(127, 8).PadRight(3, ' ') + " \u2502 " + 127.ToString().PadRight(3, ' ') + " \u2502 " + Convert.ToString(127, 16).PadRight(3, ' ') + " \u2502 " + "control".PadRight(7, ' ') + " \u2502");
  22.         Console.WriteLine("\u2514" + new string('\u2500', 10) + "\u2534" + new string('\u2500', 5) + "\u2534" + new string('\u2500', 5) + "\u2534" + new string('\u2500', 5) + "\u2534" + new string('\u2500', 9) + "\u2518");
  23.     }
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top