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 Lesson_4._2
- {
- class Program
- {
- static void Main(string[] args)
- {
- DrowHealthBar();
- DrowHealthBar(1,1,40);
- DrowHealthBar(2,2,50);
- DrowHealthBar(3,3,10);
- Console.Read();
- }
- static void DrowHealthBar(int x = 0, int y = 0, int health = 100)
- {
- Console.SetCursorPosition(x, y);
- int full = 10;
- int fill = health / full;
- Console.Write('[' + new String('#', fill) + new String('_', full - fill) + ']');
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement