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 ConsoleApp8
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Введите колво хп от 0 до 10");
- hpbar(Convert.ToInt32(Console.ReadLine()));
- }
- static void hpbar(int i)
- {
- char[] hp = new char[10];
- for (int g = 0; g < i; g++)
- {
- hp[g] = Convert.ToChar("#");
- }
- for (int h = 0; h < hp.Length; h++)
- {
- if (hp[h] != Convert.ToChar("#"))
- {
- hp[h] = Convert.ToChar("_");
- }
- }
- Console.Write("[");
- for (int h = 0; h < hp.Length; h++)
- {
- Console.Write(hp[h]);
- }
- Console.Write("]");
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement