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 ConsoleApp18
- {
- class Program
- {
- static int Health = 10;
- static void Main(string[] args)
- {
- Health = 4;
- Console.Clear();
- DrawBarData();
- }
- static void DrawBarData()
- {
- Console.Write("Health ");
- Console.Write("[" + GenerateBar(Health) + "]");
- Console.WriteLine();
- }
- static string GenerateBar(int charsQuantity, char container = '#')
- {
- string bar = "";
- for (int i = 0; i < 10; i++)
- {
- if (i > charsQuantity - 1)
- {
- bar += " ";
- }
- else
- {
- bar += container;
- }
- }
- return bar;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment