Skip to content

Instantly share code, notes, and snippets.

@HunvejBeen
Created February 6, 2025 17:55
Show Gist options
  • Save HunvejBeen/fc5ee71626323453d9bdd3e03f5bdc24 to your computer and use it in GitHub Desktop.
Save HunvejBeen/fc5ee71626323453d9bdd3e03f5bdc24 to your computer and use it in GitHub Desktop.
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