Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace UIELEMENT
- {
- class Program
- {
- static void Main(string[] args)
- {
- int value = 4;
- int maxValue = 10;
- DrawBar(value, maxValue);
- }
- static void DrawBar(int value, int maxValue)
- {
- string bar = "";
- for (int i = 0; i < value; i++)
- {
- bar += '#';
- }
- Console.SetCursorPosition(0, 0);
- Console.Write('[');
- Console.Write(bar);
- bar = "";
- for (int i = value; i < maxValue; i++)
- {
- bar += '_';
- }
- Console.Write(bar + ']');
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement