Advertisement
Guest User

task42

a guest
Apr 25th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.IO;
  7.  
  8. namespace CLight
  9. {
  10.     class Program
  11.     {
  12.         // 4.2. UIElement
  13.         static void Main(string[] args)
  14.         {
  15.             DrawBar(0, 2, 40);
  16.             DrawBar(0, 4, 100);
  17.             DrawBar(0, 6, 10);
  18.         }
  19.         static void DrawBar(int x, int y, int barValue)
  20.         {
  21.             Console.SetCursorPosition(x, y);
  22.             Console.Write("[");
  23.             for (int i=0; i<barValue/10; i++)
  24.             {
  25.                 Console.Write("#");
  26.             }
  27.             for (int i = barValue / 10; i < (barValue / 10+(10 - (barValue / 10))); i++)
  28.             {
  29.                 Console.Write("_");
  30.             }
  31.             Console.Write("]");
  32.             Console.WriteLine();
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement