Advertisement
YavorGrancharov

Character_Stats

May 24th, 2017
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.18 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.  
  7. namespace Character_Stats
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var name = Console.ReadLine();
  14.             var currentHealth = int.Parse(Console.ReadLine());
  15.             var maximumHealth = int.Parse(Console.ReadLine());
  16.             var currentEnergy = int.Parse(Console.ReadLine());
  17.             var maximumEnergy = int.Parse(Console.ReadLine());
  18.  
  19.             Console.WriteLine("Name: " + "{0}", name);
  20.  
  21.             var health = maximumHealth - currentHealth;
  22.             var energy = maximumEnergy - currentEnergy;
  23.  
  24.             string dotsHealth = new string('.', health);
  25.             string dotsEnergy = new string('.', energy);
  26.             string lineHealth = new string('|', currentHealth + 1);
  27.             string lineEnergy = new string('|', currentEnergy + 1);
  28.             string lineRight = new string('|', 1);
  29.  
  30.             Console.WriteLine("Health: " + $"{lineHealth}{dotsHealth}{lineRight}");
  31.             Console.WriteLine("Energy: " + $"{lineEnergy}{dotsEnergy}{lineRight}");
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement