-
-
Save Kichat-sudo/4fae4d96461b2d888bfeda465cd30949 to your computer and use it in GitHub Desktop.
3.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace GameInterface | |
{ | |
class CharacterStatsDisplay | |
{ | |
static void Main() | |
{ | |
Console.WriteLine("Укажите уровень жизненной энергии (0-100%): "); | |
int lifeEnergyLevel = Convert.ToInt32(Console.ReadLine()); | |
ShowStatusVisual(lifeEnergyLevel); | |
Console.WriteLine("Укажите уровень магической энергии (0-100%): "); | |
int magicEnergyLevel = Convert.ToInt32(Console.ReadLine()); | |
ShowStatusVisual(magicEnergyLevel); | |
} | |
static void ShowStatusVisual(int percentageValue) | |
{ | |
const int visualLength = 25; | |
int activeSegments = visualLength * percentageValue / 100; | |
string activeVisual = new string('■', activeSegments); | |
string inactiveVisual = new string('·', visualLength - activeSegments); | |
Console.WriteLine($"|{activeVisual}{inactiveVisual}|"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment