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 ConsoleApplication2
- {
- class Program
- {
- static bool UserDeath = false;
- static int Health = 100;
- static int CurrentHealth;
- static int DMG;
- static string UserDmg;
- static string UserName;
- static void Main(string[] args)
- {
- Console.WriteLine("Ваше имя?");
- UserName = Console.ReadLine();
- Console.Clear();
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.WriteLine(UserName.PadLeft(20));
- Console.ForegroundColor = ConsoleColor.Green;
- Console.WriteLine(" Ваше здоровье = " + Health);
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine(" Какой урон вы хотите нанести " + UserName);
- UserDmg = Console.ReadLine();
- DMG = Convert.ToInt32(UserDmg);
- CurrentHealth = Health - DMG;
- if (CurrentHealth > 0) { }
- else
- {
- UserDeath = true;
- string DeathUser = UserName;
- }
- Console.WriteLine(" Осталось здоровья: " + CurrentHealth);
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment