Created
February 6, 2025 17:55
-
-
Save HunvejBeen/fc5ee71626323453d9bdd3e03f5bdc24 to your computer and use it in GitHub Desktop.
This file contains 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 DZ_1 | |
{ | |
internal class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Player player = new Player("Tom", 100, 15, 10); | |
player.ShowStats(); | |
} | |
} | |
class Player | |
{ | |
public string _name; | |
public int _health; | |
public int _armor; | |
public int _damage; | |
public Player(string name, int health,int armor, int damage) | |
{ | |
_name = name; | |
_health = health; | |
_armor = armor; | |
_damage = damage; | |
} | |
public void ShowStats() | |
{ | |
Console.WriteLine($"Моё имя - {_name}. У меня {_health} здоровья, {_armor} брони и {_damage} урона."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment