Advertisement
rivalcoba

Impresion unicode

Apr 27th, 2020
405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.37 KB | None | 0 0
  1. using System;
  2. using static System.Console;
  3. namespace Laboratorio_4
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             // Configurar la codificacion de la consola
  10.             OutputEncoding = System.Text.Encoding.Unicode;
  11.             Clear();
  12.             //char c = '\u2593';
  13.             Write("> Ingrese la altura del rectangulo: ");
  14.             int height = int.Parse(ReadLine());
  15.             Write("> Ingrese la ancho del rectangulo: ");
  16.             int width = int.Parse(ReadLine());
  17.             Write("> Ingrese el unicide del carácter de impresion: ");
  18.             int unicode_symbol = int.Parse(ReadLine(), System.Globalization.NumberStyles.HexNumber);
  19.             // Dont Repeat Yourself
  20.             // Configurando los colores de la figura
  21.             ForegroundColor = ConsoleColor.Blue;
  22.             BackgroundColor = ConsoleColor.DarkRed;
  23.             for (int shape_height = 1; shape_height <= height; shape_height++)
  24.             {
  25.                 for (int shape_with = 1; shape_with <= width; shape_with++)
  26.                 {
  27.                     // Write("{0}", ((char)unicode_symbol).ToString());
  28.                     Write("{0}", (char)unicode_symbol);
  29.                 }
  30.                 WriteLine("");
  31.             }
  32.             // Reestableciendo el color de impresion original
  33.             ResetColor();
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement