VelizarAvramov

05. Character Stats

Nov 3rd, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _05._Character_Stats
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string name = Console.ReadLine();
  10.             int currentHealth = int.Parse(Console.ReadLine());
  11.             int maxHealth = int.Parse(Console.ReadLine());
  12.             int currentEnergy = int.Parse(Console.ReadLine());
  13.             int maxEnergy = int.Parse(Console.ReadLine());
  14.  
  15.             Console.WriteLine($"Name: {name}");
  16.  
  17.             string health = new string('|', currentHealth) + new string('.', maxHealth - currentHealth);
  18.  
  19.             string energy = new string('|', currentEnergy) + new string('.', maxEnergy - currentEnergy);
  20.  
  21.             Console.WriteLine($"Health: |{health}|");
  22.             Console.WriteLine($"Energy: |{energy}|");
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment