Advertisement
NastySwipy

C# Intro and Basic Syntax - Exercises - 05. Character Stats

Mar 22nd, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1. using System;
  2. namespace _01_IntroandBasicSyntax_Exercises
  3. {
  4.     class Program
  5.     {
  6.         static void Main(string[] args)
  7.         {
  8.             string nameCharacter = Console.ReadLine();
  9.             int currentHealth = int.Parse(Console.ReadLine());
  10.             int maximumHealth = int.Parse(Console.ReadLine());
  11.             int currentEnerg = int.Parse(Console.ReadLine());
  12.             int maximumEnergy = int.Parse(Console.ReadLine());
  13.  
  14.             Console.WriteLine($"Name: {nameCharacter}");
  15.             Console.WriteLine($"Health: |{new string('|', currentHealth)}{new string('.', maximumHealth - currentHealth)}|");
  16.             Console.WriteLine($"Energy: |{new string('|', currentEnerg)}{new string('.', maximumEnergy - currentEnerg)}|");
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement