{"id":480714,"date":"2026-05-23T06:31:10","date_gmt":"2026-05-23T06:31:10","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=480714"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=480714","title":{"rendered":"\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u0431\u0430\u0442\u0442\u043b-\u0430\u0440\u0435\u043d\u044b \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421++ \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u00ab\u0443\u043c\u043d\u044b\u0445\u00bb \u0431\u043e\u0442\u043e\u0432"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><strong>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/strong>\u00a0\u041a\u0430\u043a\u2011\u0442\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0443\u00a0\u043c\u0435\u043d\u044f \u0438\u0434\u0435\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u0431\u043e\u0439\u0446\u043e\u0432\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u0443\u0431\u0430, \u043d\u043e\u00a0\u0447\u0442\u043e\u0431\u044b \u0431\u043e\u0439\u00a0\u0431\u044b\u043b \u043d\u0435\u00a0\u043a\u0443\u043b\u0430\u0447\u043d\u044b\u0439, \u0430\u00a0\u0441\u00a0\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043c\u0435\u0445\u0430\u043d\u0438\u043a, \u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u044f \u043b\u044e\u0431\u043b\u044e \u0444\u044d\u043d\u0442\u0435\u0437\u0438 \u0438 \u0444\u0430\u043d\u0442\u0430\u0441\u0442\u0438\u043a\u0443 \u0438 \u043c\u043e\u0438\u043c\u0438 \u043b\u044e\u0431\u0438\u043c\u044b\u043c\u0438 \u0441\u0430\u0433\u0430\u043c\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f:\u00ab\u0412\u0435\u0434\u044c\u043c\u0430\u043a\u00bb \u0438 \u00ab\u0412\u043b\u0430\u0441\u0442\u0435\u043b\u0438\u043d \u043a\u043e\u043b\u0435\u0446\u00bb(\u0434\u0430 \u0410\u0437\u043e\u0433 \u0438\u0437\u00a0\u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u043d\u0438\u0433\u0438, \u043d\u043e\u00a0\u044d\u0442\u043e \u0432\u0435\u0434\u044c \u043e\u0434\u043d\u0430 \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u0430\u044f), \u0442\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u043a \u0434\u043b\u044f\u00a0\u0443\u0441\u0432\u043e\u0435\u043d\u0438\u044f \u0442\u0435\u043e\u0440\u0438\u0438, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u0438\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0442\u0430\u043a\u0438\u0445 \u043c\u0435\u0439\u043d\u0441\u0442\u0440\u0438\u043c\u043d\u044b\u0445 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0445 \u0438\u0433\u0440 \u043a\u0430\u043a\u00a0\u0437\u043c\u0435\u0439\u043a\u0430 \u0438 \u043c\u043e\u0440\u0441\u043a\u043e\u0439 \u0431\u043e\u0439.<\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430\u00a0\u0447\u0438\u0441\u0442\u043e\u043c \u0421++ \u0431\u0435\u0437\u00a0\u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u00ab\u044d\u043a\u0437\u043e\u0442\u0438\u043a\u0430\u00bb \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e #include &lt;windows.h&gt;, \u043d\u043e\u00a0\u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0432\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u0434\u043b\u044f\u00a0\u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0441\u043c\u043e\u0433 \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u043d\u0430\u00a0\u044d\u043a\u0440\u0430\u043d\u0435(\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431, \u043a\u0430\u043a\u00a0\u0432\u0430\u043c \u0443\u0433\u043e\u0434\u043d\u043e).<\/p>\n<hr\/>\n<h2>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u0430\u0440\u0442\u044b \u0438 \u0435\u0451 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430<\/h2>\n<p>\u041a\u0430\u0440\u0442\u0430 \u043f\u043e \u043a\u0430\u043d\u043e\u043d\u0443 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 char.<\/p>\n<pre><code class=\"cpp\">const int HEIGHT = 14;const int WIDTH = 14;char MAP[HEIGHT][WIDTH] ={    '#','#','#','#','#','#','#','#','#','#','#','#','#','#',    '#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',    '#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',    '#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',    '#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',    '#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',    '#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',    '#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',    '#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',    '#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',    '#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',    '#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',    '#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',    '#','#','#','#','#','#','#','#','#','#','#','#','#','#'};<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u043e\u0439 \u043a\u0430\u0440\u0442\u044b \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f showMap(&#8230;), \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 main.cpp. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u0432\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 Character, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0447\u0443\u0442\u044c \u043d\u0438\u0436\u0435.<\/p>\n<pre><code class=\"cpp\">void showMap(Character* ch1, Character* ch2){    for (int i = 0; i &lt; HEIGHT; i++)    {        for (int j = 0; j &lt; WIDTH; j++)        {            if (i == ch1-&gt;getPosY() &amp;&amp; j == ch1-&gt;getPosX())            {                cout &lt;&lt; ch1-&gt;getAppearance();\/\/\u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0431\u043e\u0439\u0446\u0430 1 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d            }            else if (i == ch2-&gt;getPosY() &amp;&amp; j == ch2-&gt;getPosX())            {                cout &lt;&lt; ch2-&gt;getAppearance();\/\/\u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0431\u043e\u0439\u0446\u0430 2 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d            }            else cout &lt;&lt; MAP[i][j];\/\/\u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0430\u0440\u0435\u043d\u044b \u0438 \u043d\u0435\u0437\u0430\u043d\u044f\u0442\u044b\u0435 \u043a\u043b\u0435\u0442\u043a\u0438 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d        }        cout &lt;&lt; endl;    }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h2>\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441<\/h2>\n<p>\u041f\u0440\u043e\u0431\u0435\u0436\u0438\u043c\u0441\u044f \u043f\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0443 \u043a\u043b\u0430\u0441\u0441\u0430, \u043d\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044f \u0432\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0433\u0435\u0442\u0442\u0435\u0440\u044b \u0438 \u0441\u0435\u0442\u0442\u0435\u0440\u044b, \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u0430\u043b\u043e\u0436\u0435\u043d\u0430 \u0432 \u0438\u0445 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u0445 get-\u0432\u044b\u0434\u0430\u0442\u044c, set-\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c. <\/p>\n<pre><code class=\"cpp\">class Character {protected:    string name;\/\/\u0438\u043c\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436\u0430    string feature;\/\/\u0435\u0433\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c(\u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e)    char appearance;\/\/\u043e\u0442\u043e\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435    int HP;\/\/\u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u044f    int damage;\/\/\u0441\u043a\u043e\u043b\u044c\u043a\u043e HP \u0441\u043d\u0438\u043c\u0430\u0435\u0442 \u0431\u043b\u0438\u0436\u043d\u044f\u044f \u0430\u0442\u0430\u043a\u0430    string weapon;\/\/\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043e\u0440\u0443\u0436\u0438\u044f    int posX, posY;\/\/\u043f\u043e\u0437\u0438\u0446\u0438\u044f \u043d\u0430 \u0430\u0440\u0435\u043d\u0435public:    Character(string C = \"Unknown\", int h = 100, int d = 10, int x = 5, int y = 5, string f = \"close combat\", char ch = 'W',string w=\"sword\");    virtual ~Character() {}    \/\/\u0433\u0435\u0442\u0442\u0435\u0440\u044b     string getName() const { return name; }    int getHP() const { return HP; }    int getDamage() const { return damage; }    char getAppearance() const { return appearance; }    string getFeature() const { return feature; }    string getWeapon()const { return weapon; }    int getPosX()const { return posX; };    int getPosY()const { return posY; };    \/\/\u0441\u0435\u0442\u0442\u0435\u0440\u044b    int setHP(int hp=0) { return HP=hp; };    \/\/\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b    void move(int dx, int dy, Character&amp; o);\/\/\u043f\u0435\u0440\u0435\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u0430\u0440\u0435\u043d\u0435    bool inBorders(int d)const;\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0435 \u0433\u0440\u0430\u043d\u0438\u0446\u044b    bool isOccupied(int y, int x, Character&amp; o)const;\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0437\u0430\u043d\u044f\u0442\u043e\u0441\u0442\u044c \u043a\u043b\u0435\u0442\u043a\u0438 \u043d\u0430 \u0430\u0440\u0435\u043d\u0435,\u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0441\u0442\u043e\u043b\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0431\u043e\u0439\u0446\u043e\u0432    void toRun(Character&amp; o, bool isUnderAttack);\/\/\u043e\u0442\u0431\u0435\u0436\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0432\u0440\u0430\u0433 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0432 \u0431\u043b\u0438\u0436\u043d\u0435\u043c \u0431\u043e\u044e    void toPursue(Character&amp; o);\/\/\u043f\u0440\u0435\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0432\u0440\u0430\u0433\u0430, \u0435\u0441\u043b\u0438 \u043e\u043d \u0441\u043b\u0430\u0431 \u0432 \u0431\u043b\u0438\u0436\u043d\u0435\u043c \u0431\u043e\u044e    bool isAllowedToAttack(Character&amp; o)const;\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438 \u0431\u043b\u0438\u0437\u043a\u043e \u043f\u043e\u0434\u043e\u0448\u0435\u043b \u0434\u043b\u044f \u0431\u043b\u0438\u0436\u043d\u0435\u0439 \u0430\u0442\u0430\u043a\u0438    void showCloseAttack(Character&amp; o)const;\/\/\u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0431\u043b\u0438\u0436\u043d\u044e\u044e \u0430\u0442\u0430\u043a\u0443 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435    void animateRemoteAttack(Character&amp; o, char symb);\/\/\u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0430\u0442\u0430\u043a\u0443 \u043d\u0430 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0438    void showRemoteAttack(Character&amp; o, int x, int y, char&amp; symb);\/\/\u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0441\u0442\u0440\u0435\u043b\u044b(\u043f\u043b\u0430\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0448\u0430\u0440\u0430) \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442    virtual void Attack(Character&amp; obj) = 0;    virtual bool isOnSight(Character&amp; obj) = 0;    virtual void Character_info(Character&amp; obj) = 0;    friend ostream&amp; operator&lt;&lt;(ostream&amp; os, Character&amp; o);\/\/\u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436\u0435};<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <strong>isOccupied(&#8230;)<\/strong> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0435 \u0437\u0430\u043d\u044f\u0442\u0430 \u043b\u0438 \u043a\u043b\u0435\u0442\u043a\u0430, \u043a\u0443\u0434\u0430 \u0445\u043e\u0447\u0435\u0442 \u0448\u0430\u0433\u043d\u0443\u0442\u044c \u0431\u043e\u0435\u0446 1 \u0431\u043e\u0439\u0446\u043e\u043c 2.<\/p>\n<pre><code class=\"cpp\">bool Character::isOccupied(int y, int x,Character&amp; o) const{    return o.getPosY() == y&amp;&amp;o.getPosX()==x;}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <strong>move(&#8230;) <\/strong>\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c \u0431\u043e\u0439\u0446\u0430 \u043f\u043e \u043f\u043e\u043b\u044e, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044f \u043a\u0430\u0436\u0434\u0443\u044e \u043a\u043b\u0435\u0442\u043a\u0443 \u043d\u0430 \u0437\u0430\u043d\u044f\u0442\u043e\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u043c \u0431\u043e\u0439\u0446\u043e\u043c. \u0414\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0432 \u0444\u0430\u0439\u043b\u0435 main.cpp: void move_ch(int&amp; d, Character&amp; o, Character&amp; check) \u0438 void move_ch_opposite(int&amp; d, Character&amp; o, Character&amp; check) \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u0432\u044b\u0431\u043e\u0440\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442.<\/p>\n<pre><code class=\"cpp\">void Character::move(int dx, int dy,Character&amp; o)  {    if (isOccupied(posY + dy, posX + dx, o))    {        int ddx = -dx;        int ddy = -dy;        int newX = posX + ddx;        int newY = posY + ddy;        if (MAP[newY][newX] != '#')        {            posX = newX; posY = newY;        }        else        {            posX += 0;            posY += 0;        }    }    else    {        posX += dx; posY += dy;    }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f<strong> inBorders(&#8230;)<\/strong> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0435 \u0432\u044b\u0448\u0435\u043b \u043b\u0438 \u0431\u043e\u0435\u0446 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0430\u0440\u0435\u043d\u044b. \u0415\u0441\u043b\u0438 \u0432\u044b\u0448\u0435\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 false, \u0438\u043d\u0430\u0447\u0435 true.<\/p>\n<pre><code class=\"cpp\">bool Character::inBorders(int d) const {     int newX = posX;    int newY = posY;    switch (d) {    case UP:    newY--; break;    case DOWN:  newY++; break;    case LEFT:  newX--; break;    case RIGHT: newX++; break;    default: return false;    }    \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u044b\u0445\u043e\u0434\u0430 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430    if (newX &lt; 1 || newX &gt;= WIDTH-1 || newY &lt; 1 || newY &gt;= HEIGHT-1)        return false;    \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0442\u0435\u043d\u044b     if (MAP[newY][newX] == '#') return false;    return true;}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f  <strong>toRun(&#8230;)<\/strong> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u043e\u0431\u0435\u0433\u0430 \u043e\u0442 \u0431\u043e\u043b\u0435\u0435 \u0441\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u043e\u0439\u0446\u0430. \u0415\u0441\u043b\u0438 \u0431\u043e\u0435\u0446 1 \u0441\u0438\u043b\u044c\u043d\u0435\u0435 \u0431\u043e\u0439\u0446\u0430 2 \u0432 \u0431\u043b\u0438\u0436\u043d\u0435\u043c \u0431\u043e\u044e \u0438 \u0431\u043e\u0435\u0446 1 \u043d\u0430\u043d\u043e\u0441\u0438\u0442 \u0443\u0440\u043e\u043d \u0431\u043e\u0439\u0446\u0443 2, \u0442\u043e \u0431\u043e\u0435\u0446 2 \u0441\u0442\u0430\u0440\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0430\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430.<\/p>\n<pre><code class=\"cpp\">void Character::toRun(Character&amp; o, bool isUnderAttack){    if (!isUnderAttack) return;          \/\/ \u0443\u0431\u0435\u0433\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0443\u0434\u0430\u0440\u0430    int x_enemy = o.getPosX();    int y_enemy = o.getPosY();    int x_me = posX;    int y_me = posY;    \/\/ \u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u041e\u0422 \u0432\u0440\u0430\u0433\u0430    int dx = 0, dy = 0;    if (x_me &lt; x_enemy) dx = -1;         \/\/ \u0432\u0440\u0430\u0433 \u0441\u043f\u0440\u0430\u0432\u0430 - \u0431\u0435\u0436\u0438\u043c \u0432\u043b\u0435\u0432\u043e    else if (x_me &gt; x_enemy) dx = 1;     \/\/ \u0432\u0440\u0430\u0433 \u0441\u043b\u0435\u0432\u0430 \u2013 \u0431\u0435\u0436\u0438\u043c \u0432\u043f\u0440\u0430\u0432\u043e    if (dx == 0)    {        if (y_me &lt; y_enemy) dy = -1;         \/\/ \u0432\u0440\u0430\u0433 \u0441\u043d\u0438\u0437\u0443 \u2013 \u0431\u0435\u0436\u0438\u043c \u0432\u0432\u0435\u0440\u0445        else if (y_me &gt; y_enemy) dy = 1;     \/\/ \u0432\u0440\u0430\u0433 \u0441\u0432\u0435\u0440\u0445\u0443 \u2013 \u0431\u0435\u0436\u0438\u043c \u0432\u043d\u0438\u0437    }    int newX = x_me + dx;    int newY = y_me + dy;    \/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 (\u0441\u0442\u0435\u043d\u044b + \u0433\u0440\u0430\u043d\u0438\u0446\u044b)    auto isWalkable = [](int x, int y) -&gt; bool {        return (x &gt;= 1 &amp;&amp; x &lt; WIDTH - 1 &amp;&amp; y &gt;= 1 &amp;&amp; y &lt; HEIGHT - 1 &amp;&amp; MAP[y][x] != '#');        };    if (isWalkable(newX, newY)) {        move(dx, dy, o);        return;    }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <strong>toPursue(&#8230;) <\/strong>\u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u0430 \u043f\u043e \u043b\u043e\u0433\u0438\u043a\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong>toRun(&#8230;)<\/strong>: \u0431\u043e\u043b\u0435\u0435 \u0441\u0438\u043b\u044c\u043d\u044b\u0439 \u0431\u043e\u0435\u0446 \u043f\u0440\u0435\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u0430\u0431\u043e\u0433\u043e \u043f\u043e\u043a\u0430 \u043d\u0435 \u0441\u0431\u043b\u0438\u0437\u0438\u0442\u0441\u044f \u0441 \u043d\u0438\u043c.<\/p>\n<pre><code class=\"cpp\">void Character::toPursue(Character&amp; o){    int x_enemy = o.getPosX();    int y_enemy = o.getPosY();    int x_me = posX;    int y_me = posY;    int dist = sqrt(pow(x_enemy - x_me, 2) + pow(y_enemy - y_me, 2));    if (dist &lt;= 1) return;              \/\/ \u0443\u0436\u0435 \u0440\u044f\u0434\u043e\u043c \u2013 \u0430\u0442\u0430\u043a\u0443\u0435\u043c \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435    \/\/ \u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a \u0432\u0440\u0430\u0433\u0443    int dx = 0, dy = 0;    if (x_me &lt; x_enemy) dx = 1;    else if (x_me &gt; x_enemy) dx = -1;    if (dx == 0)    {        if (y_me &lt; y_enemy) dy = 1;        else if (y_me &gt; y_enemy) dy = -1;    }    int newX = x_me + dx;    int newY = y_me + dy;    \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0441\u0442\u0435\u043d\u044b    bool walkable = (newX &gt;= 1 &amp;&amp; newX &lt; WIDTH - 1 &amp;&amp; newY &gt;= 1 &amp;&amp; newY &lt; HEIGHT - 1 &amp;&amp; MAP[newY][newX] != '#');    \/\/ \u0417\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043a\u043b\u0435\u0442\u043a\u0443 \u0432\u0440\u0430\u0433\u0430    if (walkable &amp;&amp; (newX != x_enemy || newY != y_enemy))        move(dx, dy, o);}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <strong>isAllowedToAttack(&#8230;) <\/strong>\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438 \u0431\u043b\u0438\u0437\u043a\u043e \u043f\u043e\u0434\u043e\u0448\u0435\u043b \u0431\u043e\u0435\u0446 1 \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0430\u0442\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u0439\u0446\u0430 2 \u0432 \u0431\u043b\u0438\u0436\u043d\u0435\u043c \u0431\u043e\u044e. \u0427\u0438\u0441\u043b\u043e 1.5 \u0432\u044b\u0431\u0440\u0430\u043d\u043e \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0442\u043e\u0433\u043e \u0447\u0442\u043e sqrt(2) \u044d\u0442\u043e \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e 1,41 , \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0431\u0438\u0442\u044c \u043f\u043e \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438 \u043c\u043e\u0436\u043d\u043e.<\/p>\n<pre><code class=\"cpp\">bool Character::isAllowedToAttack(Character&amp; o)const{    int x_enemy = o.getPosX();    int y_enemy = o.getPosY();    int x_me = posX;    int y_me = posY;    double distance = sqrt(pow(x_me - x_enemy, 2) + pow(y_me - y_enemy, 2));    return distance &lt;= 1.5;}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <strong>showCloseAttack(&#8230;)<\/strong> \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u043a\u0430\u0440\u0442\u0443 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0431\u043e\u0439\u0446\u0430 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043d\u0430\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0443\u0440\u043e\u043d \u0432 \u0432\u0438\u0434\u0435 &#8216;X&#8217;.<\/p>\n<pre><code class=\"cpp\">void Character::showCloseAttack(Character&amp; o) const{    system(\"cls\");    for (int i = 0; i &lt; HEIGHT; i++)    {        for (int j = 0; j &lt; WIDTH; j++)        {            if (i == posY &amp;&amp; j == posX)            {                cout &lt;&lt; getAppearance();            }            else if (i == o.getPosY() &amp;&amp; j == o.getPosX())            {                cout &lt;&lt; 'X';            }            else cout &lt;&lt; MAP[i][j];        }        cout &lt;&lt; endl;    }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <strong>showRemoteAttack(&#8230;)<\/strong> \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0441\u043d\u0430\u0440\u044f\u0434\u0430 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043a\u0430\u0434\u0440\u0435. \u0421\u0430\u043c\u0430 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u0435\u0442\u0430 \u0441\u043d\u0430\u0440\u044f\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong>animateRemoteAttack(&#8230;)<\/strong>.<\/p>\n<pre><code class=\"cpp\">void Character::showRemoteAttack(Character&amp; o, int x, int y, char&amp; symb){    for (int i = 0; i &lt; HEIGHT; i++)    {        for (int j = 0; j &lt; WIDTH; j++)        {            if (i == posY &amp;&amp; j == posX)            {                cout &lt;&lt; getAppearance();            }            else if (i == o.getPosY() &amp;&amp; j == o.getPosX())            {                cout &lt;&lt; o.getAppearance();            }            else if (i == y &amp;&amp; j == x)cout &lt;&lt; symb;            else cout &lt;&lt; MAP[i][j];        }        cout &lt;&lt; endl;    }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f  <strong>animateRemoteAttack(&#8230;)<\/strong>,<strong> <\/strong>\u043a\u0430\u043a \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432\u044b\u0448\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0443 \u043f\u043e\u043b\u0435\u0442\u0430 \u0441\u043d\u0430\u0440\u044f\u0434\u0430. \u041f\u0440\u0438 \u0440\u0430\u0441\u0447\u0435\u0442\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0448\u0430\u0433\u043e\u0432 \u0434\u043e \u0446\u0435\u043b\u0438 \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u043b \u0434\u043b\u0438\u043d\u0443 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0438 \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u043c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u043e \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0438 \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u0439 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435 \u0441\u043d\u0430\u0440\u044f\u0434 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0434\u043b\u044f \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0430 \u043f\u043e \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438. <strong>\u042f \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u044b\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u044f\u0442 \u0434\u0430\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438 \u0441\u043a\u0430\u0436\u0443\u0442 \u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u043d\u0438 \u043d\u0430\u0448\u043b\u0438 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/strong><\/p>\n<pre><code class=\"cpp\">void Character::animateRemoteAttack(Character&amp; o, char symb){    system(\"cls\");    int x_target = o.getPosX();    int y_target = o.getPosY();    int dx = (x_target &gt; posX) ? 1 : (x_target &lt; posX) ? -1 : 0;    int dy = (y_target &gt; posY) ? 1 : (y_target &lt; posY) ? -1 : 0;    double realDistance = sqrt(dx * dx + dy * dy);    int steps = int(realDistance);    for (int i = 0; i &lt;= steps; i++)    {        int cx = posX + dx * i, cy = posY + dy * i;        showRemoteAttack(o, cx, cy, symb);        Sleep(100);        system(\"cls\");    }    showCloseAttack(o);    Sleep(100);}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0447\u0438\u0441\u0442\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0445 \u0435\u043c\u0443.<\/p>\n<h2>\u041a\u043b\u0430\u0441\u0441 Warrior<\/h2>\n<p>\u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<pre><code class=\"cpp\">class Warrior : virtual public Character {     string ArmorName;\/\/\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0431\u0440\u043e\u043d\u0438    int remote_damage;\/\/\u0443\u0440\u043e\u043d \u043e\u0442 \u0434\u0430\u043b\u044c\u043d\u0435\u0439 \u0430\u0442\u0430\u043a\u0438    int defense;\/\/\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0445\u043f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0431\u0440\u043e\u043d\u0438    int SwordSharpness;\/\/\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0440\u043e\u043d \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043e\u0441\u0442\u0440\u043e\u0442\u044b \u043a\u043b\u0438\u043d\u043a\u0430public:    Warrior(string cl, int hp, int dam, int x, int y, string f, char a,string w,        string A = \"Wolf school armor\", int def = 25, int SS = 10, int rd = 10)        : Character(cl, hp, dam, x, y, f, a,w), ArmorName(A), defense(def), SwordSharpness(SS),remote_damage(rd) {        HP += defense;    }    virtual ~Warrior() {}    \/\/\u0433\u0435\u0442\u0442\u0435\u0440\u044b    string getArmorName()const { return ArmorName; }    int getRemote_Damage()const { return remote_damage; }    int get_defense()const { return defense; }    int getSwordSharpness()const { return SwordSharpness; }    \/\/\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b    void Attack(Character&amp; o)override;\/\/\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0430\u0442\u0430\u043a\u0438(\u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043b\u043e\u0433\u0438\u043a\u0430 \u043e\u0442\u043d\u0438\u043c\u0430\u043d\u0438\u044f HP \u043f\u0440\u0438 \u0443\u0434\u0430\u0440\u0435),\u0442.\u043a. \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u043f.\u0443\u0440\u043e\u043d \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043e\u0441\u0442\u0440\u043e\u0442\u044b \u043a\u043b\u0438\u043d\u043a\u0430    void Remote_Attack(Character&amp; o);\/\/\u0430\u0442\u0430\u043a\u0430 \u043d\u0430 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0440\u0431\u0430\u043b\u0435\u0442\u0430    bool isAllowedRemoteAttack(Character&amp; o);\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0430\u0442\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u0430\u0440\u0431\u0430\u043b\u0435\u0442\u0430, \u0435\u0441\u043b\u0438 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043b\u0438\u0437\u043a\u043e \u0438\u043b\u0438 \u0434\u0430\u043b\u0435\u043a\u043e - \u043d\u0435 \u0430\u0442\u0430\u043a\u043e\u0432\u0430\u0442\u044c    bool isOnSight(Character&amp; obj)override;\/\/\u0432\u0438\u0440\u0443\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0432\u0440\u0430\u0433\u0430 \u0432 \u043f\u043e\u043b\u0435 \u0437\u0440\u0435\u043d\u0438\u044f    void Character_info(Character&amp; obj)override;\/\/\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0430\u0442\u0430\u043a\u0435:\u043a\u0442\u043e \u043a\u043e\u0433\u043e \u0430\u0442\u0430\u043a\u043e\u0432\u0430\u043b,\u0442\u0438\u043f \u0430\u0442\u0430\u043a\u0438(\u0432\u0431\u043b\u0438\u0437\u0438), \u0441\u043a\u043e\u043b\u044c\u043a\u043e HP \u0441\u043d\u0435\u0441\u043b\u0430 \u0430\u0442\u0430\u043a\u0430 \u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e HP \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0443 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430    void Character_info_remote(Character&amp; obj);\/\/\u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0430\u0442\u0430\u043a\u0435:\u043a\u0442\u043e \u043a\u043e\u0433\u043e \u0430\u0442\u0430\u043a\u043e\u0432\u0430\u043b,\u0442\u0438\u043f \u0430\u0442\u0430\u043a\u0438(\u043d\u0430 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0438), \u0441\u043a\u043e\u043b\u044c\u043a\u043e HP \u0441\u043d\u0435\u0441\u043b\u0430 \u0430\u0442\u0430\u043a\u0430 \u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e HP \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0443 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430    friend ostream&amp; operator&lt;&lt;(ostream&amp; os, const Warrior&amp; o); \/\/\u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u043a\u043b\u0430\u0441\u0441\u0430};<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h2>\u041a\u043b\u0430\u0441\u0441 Orc<\/h2>\n<pre><code class=\"cpp\">class Orc :virtual public Character{private:string race;\/\/\u0440\u0430\u0441\u0430 \u043e\u0440\u043a\u0430int buff;\/\/\u0434\u043e\u043f.\u0443\u0440\u043e\u043d \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0440\u0430\u0441\u044bpublic:Orc(string cl, int hp, int dam, int x, int y, string f, char a,string w,string r=\"Grey orc\", int b=20) :Character(cl, hp, dam, x, y, f, a,w), race(r), buff(b) { }virtual ~Orc() {}void Attack(Character&amp; o)override;\/\/\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0430\u0442\u0430\u043a\u0438(\u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043b\u043e\u0433\u0438\u043a\u0430 \u043e\u0442\u043d\u0438\u043c\u0430\u043d\u0438\u044f HP \u043f\u0440\u0438 \u0443\u0434\u0430\u0440\u0435),\u0442.\u043a. \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u043f.\u0443\u0440\u043e\u043d \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0440\u0430\u0441\u044b \u043e\u0440\u043a\u0430(\u0444\u0438\u0437.\u0441\u0438\u043b\u0430)bool isOnSight(Character&amp; o)override;\/\/\u0432\u0438\u0440\u0443\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0432\u0440\u0430\u0433\u0430 \u0432 \u043f\u043e\u043b\u0435 \u0437\u0440\u0435\u043d\u0438\u044f(\u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u044e \u0434\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c)void Character_info(Character&amp; obj)override;\/\/\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0430\u0442\u0430\u043a\u0435:\u043a\u0442\u043e \u043a\u043e\u0433\u043e \u0430\u0442\u0430\u043a\u043e\u0432\u0430\u043b,\u0442\u0438\u043f \u0430\u0442\u0430\u043a\u0438(\u0432\u0431\u043b\u0438\u0437\u0438), \u0441\u043a\u043e\u043b\u044c\u043a\u043e HP \u0441\u043d\u0435\u0441\u043b\u0430 \u0430\u0442\u0430\u043a\u0430 \u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e HP \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0443 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430friend ostream&amp; operator&lt;&lt;(ostream&amp; os, const Orc&amp; o);\/\/\u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u043a\u043b\u0430\u0441\u0441\u0430};<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h2>\u041a\u043b\u0430\u0441\u0441 Magician<\/h2>\n<pre><code class=\"cpp\">class Magician :public Character{private:string power;int power_damage;public:Magician(string cl, int hp, int dam, int x, int y, string f, char a,string w,string p = \"Fire\", int pd = 25) :Character(cl, hp, dam, x, y, f, a,w),power(p),power_damage(pd){}virtual ~Magician() {}void Attack(Character&amp; o)override;\/\/\u0431\u043b\u0438\u0436\u043d\u044f\u044f \u0430\u0442\u0430\u043a\u0430 \u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u0448\u0435\u0441\u0442\u043e\u043cvoid Magic_Attack(Character&amp; o);\/\/\u0430\u0442\u0430\u043a\u0430 \u043c\u0430\u0433\u0438\u0435\u0439 \u043d\u0430 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0438bool isAllowedMagicAttack(Character&amp; o);\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0430\u0442\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0433\u0438\u0435\u0439, \u0435\u0441\u043b\u0438 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043b\u0438\u0437\u043a\u043e \u0438\u043b\u0438 \u0434\u0430\u043b\u0435\u043a\u043e - \u043d\u0435 \u0430\u0442\u0430\u043a\u043e\u0432\u0430\u0442\u044cbool isOnSight(Character&amp; obj)override;\/\/\u0432\u0438\u0434\u043d\u043e \u043b\u0438 \u0432\u0440\u0430\u0433\u0430, \u0435\u0441\u043b\u0438 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043e \u0432\u0440\u0430\u0433\u0430 \u043c\u0435\u043d\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u043e 15.0, \u0442\u043e true, \u0438\u043d\u0430\u0447\u0435 falsevoid Character_info(Character&amp; obj)override;\/\/\u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0430\u0442\u0430\u043a\u0435:\u043a\u0442\u043e \u043a\u043e\u0433\u043e \u0430\u0442\u0430\u043a\u043e\u0432\u0430\u043b,\u0442\u0438\u043f \u0430\u0442\u0430\u043a\u0438(\u0432\u0431\u043b\u0438\u0437\u0438), \u0441\u043a\u043e\u043b\u044c\u043a\u043e HP \u0441\u043d\u0435\u0441\u043b\u0430 \u0430\u0442\u0430\u043a\u0430 \u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e HP \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0443 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430void Character_info_remote(Character&amp; obj)const;\/\/\u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0430\u0442\u0430\u043a\u0435:\u043a\u0442\u043e \u043a\u043e\u0433\u043e \u0430\u0442\u0430\u043a\u043e\u0432\u0430\u043b,\u0442\u0438\u043f \u0430\u0442\u0430\u043a\u0438(\u043d\u0430 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0438), \u0441\u043a\u043e\u043b\u044c\u043a\u043e HP \u0441\u043d\u0435\u0441\u043b\u0430 \u0430\u0442\u0430\u043a\u0430 \u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e HP \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0443 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430friend ostream&amp; operator&lt;&lt;(ostream&amp; os, Magician&amp; o);\/\/\u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u043a\u043b\u0430\u0441\u0441\u0430};<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><a class=\"anchor\"><\/a><\/p>\n<p>\u041a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u043a\u043e\u0434 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0432\u043e\u0442 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e \u043b\u043e\u0433\u0438\u043a\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430: <\/p>\n<blockquote>\n<p><a href=\"https:\/\/github.com\/rebble16\/Console_battle_are\" rel=\"noopener noreferrer nofollow\">GitHub<\/a><\/p>\n<\/blockquote>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0432\u0430\u043c\u00a0\u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u0438 \u0443\u00a0\u0432\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0438\u0434\u0435\u0438 \u043a\u0430\u043a\u00a0\u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u043b\u0438\u00a0\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439! \u0414\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u0441\u0432\u043e\u0438\u043c\u0438 \u0438\u0434\u0435\u044f\u043c\u0438 \u0432\u00a0\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u0430\u043a\u00a0\u043c\u043e\u0436\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043a\u043e\u0434, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044f \u043d\u0435\u00a0\u0441\u0438\u043b\u0435\u043d \u0432\u00a0\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u0445, \u0434\u0430\u00a0\u0438 \u0432\u00a0\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u044f \u0435\u0449\u0451 \u0437\u0435\u043b\u0451\u043d\u044b\u0439.<\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1038376\/\">https:\/\/habr.com\/ru\/articles\/1038376\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!\u00a0\u041a\u0430\u043a\u2011\u0442\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0443\u00a0\u043c\u0435\u043d\u044f \u0438\u0434\u0435\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u0431\u043e\u0439\u0446\u043e\u0432\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u0443\u0431\u0430, \u043d\u043e\u00a0\u0447\u0442\u043e\u0431\u044b \u0431\u043e\u0439\u00a0\u0431\u044b\u043b \u043d\u0435\u00a0\u043a\u0443\u043b\u0430\u0447\u043d\u044b\u0439, \u0430\u00a0\u0441\u00a0\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043c\u0435\u0445\u0430\u043d\u0438\u043a, \u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u044f \u043b\u044e\u0431\u043b\u044e \u0444\u044d\u043d\u0442\u0435\u0437\u0438 \u0438 \u0444\u0430\u043d\u0442\u0430\u0441\u0442\u0438\u043a\u0443 \u0438 \u043c\u043e\u0438\u043c\u0438 \u043b\u044e\u0431\u0438\u043c\u044b\u043c\u0438 \u0441\u0430\u0433\u0430\u043c\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f:\u00ab\u0412\u0435\u0434\u044c\u043c\u0430\u043a\u00bb \u0438 \u00ab\u0412\u043b\u0430\u0441\u0442\u0435\u043b\u0438\u043d \u043a\u043e\u043b\u0435\u0446\u00bb(\u0434\u0430 \u0410\u0437\u043e\u0433 \u0438\u0437\u00a0\u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u043d\u0438\u0433\u0438, \u043d\u043e\u00a0\u044d\u0442\u043e \u0432\u0435\u0434\u044c \u043e\u0434\u043d\u0430 \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u0430\u044f), \u0442\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u043a \u0434\u043b\u044f\u00a0\u0443\u0441\u0432\u043e\u0435\u043d\u0438\u044f \u0442\u0435\u043e\u0440\u0438\u0438, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u0438\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0442\u0430\u043a\u0438\u0445 \u043c\u0435\u0439\u043d\u0441\u0442\u0440\u0438\u043c\u043d\u044b\u0445 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0445 \u0438\u0433\u0440 \u043a\u0430\u043a\u00a0\u0437\u043c\u0435\u0439\u043a\u0430 \u0438 \u043c\u043e\u0440\u0441\u043a\u043e\u0439 \u0431\u043e\u0439.\u041f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430\u00a0\u0447\u0438\u0441\u0442\u043e\u043c \u0421++ \u0431\u0435\u0437\u00a0\u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u00ab\u044d\u043a\u0437\u043e\u0442\u0438\u043a\u0430\u00bb \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e #include &lt;windows.h&gt;, \u043d\u043e\u00a0\u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0432\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u0434\u043b\u044f\u00a0\u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0441\u043c\u043e\u0433 \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u043d\u0430\u00a0\u044d\u043a\u0440\u0430\u043d\u0435(\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431, \u043a\u0430\u043a\u00a0\u0432\u0430\u043c \u0443\u0433\u043e\u0434\u043d\u043e). \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u0430\u0440\u0442\u044b \u0438 \u0435\u0451 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430\u041a\u0430\u0440\u0442\u0430 \u043f\u043e \u043a\u0430\u043d\u043e\u043d\u0443 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 char.const int HEIGHT = 14;const int WIDTH = 14;char MAP[HEIGHT][WIDTH] ={    &#8216;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,    &#8216;#&#8217;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217;#&#8217;,    &#8216;#&#8217;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217;#&#8217;,    &#8216;#&#8217;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217;#&#8217;,    &#8216;#&#8217;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217;#&#8217;,    &#8216;#&#8217;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217;#&#8217;,    &#8216;#&#8217;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217;#&#8217;,    &#8216;#&#8217;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217;#&#8217;,    &#8216;#&#8217;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217;#&#8217;,    &#8216;#&#8217;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217;#&#8217;,    &#8216;#&#8217;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217;#&#8217;,    &#8216;#&#8217;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217;#&#8217;,    &#8216;#&#8217;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217; &#8216;,&#8217;#&#8217;,    &#8216;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;,&#8217;#&#8217;};\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u043e\u0439 \u043a\u0430\u0440\u0442\u044b \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f showMap(&#8230;), \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 main.cpp. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u0432\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 Character, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0447\u0443\u0442\u044c \u043d\u0438\u0436\u0435.void showMap(Character* ch1, Character* ch2){    for (int i = 0; i &lt; HEIGHT; i++)    {        for (int j = 0; j &lt; WIDTH; j++)        {            if (i == ch1-&gt;getPosY() &amp;&amp; j == ch1-&gt;getPosX())            {                cout &lt;&lt; ch1-&gt;getAppearance();\/\/\u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0431\u043e\u0439\u0446\u0430 1 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d            }            else if (i == ch2-&gt;getPosY() &amp;&amp; j == ch2-&gt;getPosX())            {                cout &lt;&lt; ch2-&gt;getAppearance();\/\/\u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0431\u043e\u0439\u0446\u0430 2 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d            }            else cout &lt;&lt; MAP[i][j];\/\/\u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0430\u0440\u0435\u043d\u044b \u0438 \u043d\u0435\u0437\u0430\u043d\u044f\u0442\u044b\u0435 \u043a\u043b\u0435\u0442\u043a\u0438 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d        }        cout &lt;&lt; endl;    }}\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441\u041f\u0440\u043e\u0431\u0435\u0436\u0438\u043c\u0441\u044f \u043f\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0443 \u043a\u043b\u0430\u0441\u0441\u0430, \u043d\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044f \u0432\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0433\u0435\u0442\u0442\u0435\u0440\u044b \u0438 \u0441\u0435\u0442\u0442\u0435\u0440\u044b, \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u0430\u043b\u043e\u0436\u0435\u043d\u0430 \u0432 \u0438\u0445 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u0445 get-\u0432\u044b\u0434\u0430\u0442\u044c, set-\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c. class Character {protected:    string name;\/\/\u0438\u043c\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436\u0430    string feature;\/\/\u0435\u0433\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c(\u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e)    char appearance;\/\/\u043e\u0442\u043e\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435    int HP;\/\/\u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u044f    int damage;\/\/\u0441\u043a\u043e\u043b\u044c\u043a\u043e HP \u0441\u043d\u0438\u043c\u0430\u0435\u0442 \u0431\u043b\u0438\u0436\u043d\u044f\u044f \u0430\u0442\u0430\u043a\u0430    string weapon;\/\/\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043e\u0440\u0443\u0436\u0438\u044f    int posX, posY;\/\/\u043f\u043e\u0437\u0438\u0446\u0438\u044f \u043d\u0430 \u0430\u0440\u0435\u043d\u0435public:    Character(string C = &#171;Unknown&#187;, int h = 100, int d = 10, int x = 5, int y = 5, string f = &#171;close combat&#187;, char ch = &#8216;W&#8217;,string w=&#187;sword&#187;);    virtual ~Character() {}    \/\/\u0433\u0435\u0442\u0442\u0435\u0440\u044b     string getName() const { return name; }    int getHP() const { return HP; }    int getDamage() const { return damage; }    char getAppearance() const { return appearance; }    string getFeature() const { return feature; }    string getWeapon()const { return weapon; }    int getPosX()const { return posX; };    int getPosY()const { return posY; };    \/\/\u0441\u0435\u0442\u0442\u0435\u0440\u044b    int setHP(int hp=0) { return HP=hp; };    \/\/\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b    void move(int dx, int dy, Character&amp; o);\/\/\u043f\u0435\u0440\u0435\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u0430\u0440\u0435\u043d\u0435    bool inBorders(int d)const;\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0435 \u0433\u0440\u0430\u043d\u0438\u0446\u044b    bool isOccupied(int y, int x, Character&amp; o)const;\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0437\u0430\u043d\u044f\u0442\u043e\u0441\u0442\u044c \u043a\u043b\u0435\u0442\u043a\u0438 \u043d\u0430 \u0430\u0440\u0435\u043d\u0435,\u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0441\u0442\u043e\u043b\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0431\u043e\u0439\u0446\u043e\u0432    void toRun(Character&amp; o, bool isUnderAttack);\/\/\u043e\u0442\u0431\u0435\u0436\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0432\u0440\u0430\u0433 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0432 \u0431\u043b\u0438\u0436\u043d\u0435\u043c \u0431\u043e\u044e    void toPursue(Character&amp; o);\/\/\u043f\u0440\u0435\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0432\u0440\u0430\u0433\u0430, \u0435\u0441\u043b\u0438 \u043e\u043d \u0441\u043b\u0430\u0431 \u0432 \u0431\u043b\u0438\u0436\u043d\u0435\u043c \u0431\u043e\u044e    bool isAllowedToAttack(Character&amp; o)const;\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438 \u0431\u043b\u0438\u0437\u043a\u043e \u043f\u043e\u0434\u043e\u0448\u0435\u043b \u0434\u043b\u044f \u0431\u043b\u0438\u0436\u043d\u0435\u0439 \u0430\u0442\u0430\u043a\u0438    void showCloseAttack(Character&amp; o)const;\/\/\u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0431\u043b\u0438\u0436\u043d\u044e\u044e \u0430\u0442\u0430\u043a\u0443 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435    void animateRemoteAttack(Character&amp; o, char symb);\/\/\u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0430\u0442\u0430\u043a\u0443 \u043d\u0430 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0438    void showRemoteAttack(Character&amp; o, int x, int y, char&amp; symb);\/\/\u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0441\u0442\u0440\u0435\u043b\u044b(\u043f\u043b\u0430\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0448\u0430\u0440\u0430) \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442    virtual void Attack(Character&amp; obj) = 0;    virtual bool isOnSight(Character&amp; obj) = 0;    virtual void Character_info(Character&amp; obj) = 0;    friend ostream&amp; operator&lt;&lt;(ostream&amp; os, Character&amp; o);\/\/\u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436\u0435};\u0424\u0443\u043d\u043a\u0446\u0438\u044f isOccupied(&#8230;) \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0435 \u0437\u0430\u043d\u044f\u0442\u0430 \u043b\u0438 \u043a\u043b\u0435\u0442\u043a\u0430, \u043a\u0443\u0434\u0430 \u0445\u043e\u0447\u0435\u0442 \u0448\u0430\u0433\u043d\u0443\u0442\u044c \u0431\u043e\u0435\u0446 1 \u0431\u043e\u0439\u0446\u043e\u043c 2.bool Character::isOccupied(int y, int x,Character&amp; o) const{    return o.getPosY() == y&amp;&amp;o.getPosX()==x;}\u0424\u0443\u043d\u043a\u0446\u0438\u044f move(&#8230;) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c \u0431\u043e\u0439\u0446\u0430 \u043f\u043e \u043f\u043e\u043b\u044e, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044f \u043a\u0430\u0436\u0434\u0443\u044e \u043a\u043b\u0435\u0442\u043a\u0443 \u043d\u0430 \u0437\u0430\u043d\u044f\u0442\u043e\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u043c \u0431\u043e\u0439\u0446\u043e\u043c. \u0414\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0432 \u0444\u0430\u0439\u043b\u0435 main.cpp: void move_ch(int&amp; d, Character&amp; o, Character&amp; check) \u0438 void move_ch_opposite(int&amp; d, Character&amp; o, Character&amp; check) \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u0432\u044b\u0431\u043e\u0440\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442.void Character::move(int dx, int dy,Character&amp; o)  {    if (isOccupied(posY + dy, posX + dx, o))    {        int ddx = -dx;        int ddy = -dy;        int newX = posX + ddx;        int newY = posY + ddy;        if (MAP[newY][newX] != &#8216;#&#8217;)        {            posX = newX; posY = newY;        }        else        {            posX += 0;            posY += 0;        }    }    else    {        posX += dx; posY += dy;    }}\u0424\u0443\u043d\u043a\u0446\u0438\u044f inBorders(&#8230;) \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0435 \u0432\u044b\u0448\u0435\u043b \u043b\u0438 \u0431\u043e\u0435\u0446 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0430\u0440\u0435\u043d\u044b. \u0415\u0441\u043b\u0438 \u0432\u044b\u0448\u0435\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 false, \u0438\u043d\u0430\u0447\u0435 true.bool Character::inBorders(int d) const {     int newX = posX;    int newY = posY;    switch (d) {    case UP:    newY&#8212;; break;    case DOWN:  newY++; break;    case LEFT:  newX&#8212;; break;    case RIGHT: newX++; break;    default: return false;    }    \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u044b\u0445\u043e\u0434\u0430 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430    if (newX &lt; 1 || newX &gt;= WIDTH-1 || newY &lt; 1 || newY &gt;= HEIGHT-1)        return false;    \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0442\u0435\u043d\u044b     if (MAP[newY][newX] == &#8216;#&#8217;) return false;    return true;}\u0424\u0443\u043d\u043a\u0446\u0438\u044f  toRun(&#8230;) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u043e\u0431\u0435\u0433\u0430 \u043e\u0442 \u0431\u043e\u043b\u0435\u0435 \u0441\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u043e\u0439\u0446\u0430. \u0415\u0441\u043b\u0438 \u0431\u043e\u0435\u0446 1 \u0441\u0438\u043b\u044c\u043d\u0435\u0435 \u0431\u043e\u0439\u0446\u0430 2 \u0432 \u0431\u043b\u0438\u0436\u043d\u0435\u043c \u0431\u043e\u044e \u0438 \u0431\u043e\u0435\u0446 1 \u043d\u0430\u043d\u043e\u0441\u0438\u0442 \u0443\u0440\u043e\u043d \u0431\u043e\u0439\u0446\u0443 2, \u0442\u043e \u0431\u043e\u0435\u0446 2 \u0441\u0442\u0430\u0440\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0430\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430.void Character::toRun(Character&amp; o, bool isUnderAttack){    if (!isUnderAttack) return;          \/\/ \u0443\u0431\u0435\u0433\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0443\u0434\u0430\u0440\u0430    int x_enemy = o.getPosX();    int y_enemy = o.getPosY();    int x_me = posX;    int y_me = posY;    \/\/ \u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u041e\u0422 \u0432\u0440\u0430\u0433\u0430    int dx = 0, dy = 0;    if (x_me &lt; x_enemy) dx = -1;         \/\/ \u0432\u0440\u0430\u0433 \u0441\u043f\u0440\u0430\u0432\u0430 &#8212; \u0431\u0435\u0436\u0438\u043c \u0432\u043b\u0435\u0432\u043e    else if (x_me &gt; x_enemy) dx = 1;     \/\/ \u0432\u0440\u0430\u0433 \u0441\u043b\u0435\u0432\u0430 \u2013 \u0431\u0435\u0436\u0438\u043c \u0432\u043f\u0440\u0430\u0432\u043e    if (dx == 0)    {        if (y_me &lt; y_enemy) dy = -1;         \/\/ \u0432\u0440\u0430\u0433 \u0441\u043d\u0438\u0437\u0443 \u2013 \u0431\u0435\u0436\u0438\u043c \u0432\u0432\u0435\u0440\u0445        else if (y_me &gt; y_enemy) dy = 1;     \/\/ \u0432\u0440\u0430\u0433 \u0441\u0432\u0435\u0440\u0445\u0443 \u2013 \u0431\u0435\u0436\u0438\u043c \u0432\u043d\u0438\u0437    }    int newX = x_me + dx;    int newY = y_me + dy;    \/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 (\u0441\u0442\u0435\u043d\u044b + \u0433\u0440\u0430\u043d\u0438\u0446\u044b)    auto isWalkable = [](int x, int y) -&gt; bool {        return (x &gt;= 1 &amp;&amp; x &lt; WIDTH &#8212; 1 &amp;&amp; y &gt;= 1 &amp;&amp; y &lt; HEIGHT &#8212; 1 &amp;&amp; MAP[y][x] != &#8216;#&#8217;);        };    if (isWalkable(newX, newY)) {        move(dx, dy, o);        return;    }}\u0424\u0443\u043d\u043a\u0446\u0438\u044f toPursue(&#8230;) \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u0430 \u043f\u043e \u043b\u043e\u0433\u0438\u043a\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 toRun(&#8230;): \u0431\u043e\u043b\u0435\u0435 \u0441\u0438\u043b\u044c\u043d\u044b\u0439 \u0431\u043e\u0435\u0446 \u043f\u0440\u0435\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u0430\u0431\u043e\u0433\u043e \u043f\u043e\u043a\u0430 \u043d\u0435 \u0441\u0431\u043b\u0438\u0437\u0438\u0442\u0441\u044f \u0441 \u043d\u0438\u043c.void Character::toPursue(Character&amp; o){    int x_enemy = o.getPosX();    int y_enemy = o.getPosY();    int x_me = posX;    int y_me = posY;    int dist = sqrt(pow(x_enemy &#8212; x_me, 2) + pow(y_enemy &#8212; y_me, 2));    if (dist &lt;= 1) return;              \/\/ \u0443\u0436\u0435 \u0440\u044f\u0434\u043e\u043c \u2013 \u0430\u0442\u0430\u043a\u0443\u0435\u043c \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435    \/\/ \u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a \u0432\u0440\u0430\u0433\u0443    int dx = 0, dy = 0;    if (x_me &lt; x_enemy) dx = 1;    else if (x_me &gt; x_enemy) dx = -1;    if (dx == 0)    {        if (y_me &lt; y_enemy) dy = 1;        else if (y_me &gt; y_enemy) dy = -1;    }    int newX = x_me + dx;    int newY = y_me + dy;    \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0441\u0442\u0435\u043d\u044b    bool walkable = (newX &gt;= 1 &amp;&amp; newX &lt; WIDTH &#8212; 1 &amp;&amp; newY &gt;= 1 &amp;&amp; newY &lt; HEIGHT &#8212; 1 &amp;&amp; MAP[newY][newX] != &#8216;#&#8217;);    \/\/ \u0417\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043a\u043b\u0435\u0442\u043a\u0443 \u0432\u0440\u0430\u0433\u0430    if (walkable &amp;&amp; (newX != x_enemy || newY != y_enemy))        move(dx, dy, o);}\u0424\u0443\u043d\u043a\u0446\u0438\u044f isAllowedToAttack(&#8230;) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438 \u0431\u043b\u0438\u0437\u043a\u043e \u043f\u043e\u0434\u043e\u0448\u0435\u043b \u0431\u043e\u0435\u0446 1 \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0430\u0442\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u0439\u0446\u0430 2 \u0432 \u0431\u043b\u0438\u0436\u043d\u0435\u043c \u0431\u043e\u044e. \u0427\u0438\u0441\u043b\u043e 1.5 \u0432\u044b\u0431\u0440\u0430\u043d\u043e \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0442\u043e\u0433\u043e \u0447\u0442\u043e sqrt(2) \u044d\u0442\u043e \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e 1,41 , \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0431\u0438\u0442\u044c \u043f\u043e \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438 \u043c\u043e\u0436\u043d\u043e.bool Character::isAllowedToAttack(Character&amp; o)const{    int x_enemy = o.getPosX();    int y_enemy = o.getPosY();    int x_me = posX;    int y_me = posY;    double distance = sqrt(pow(x_me &#8212; x_enemy, 2) + pow(y_me &#8212; y_enemy, 2));    return distance &lt;= 1.5;}\u0424\u0443\u043d\u043a\u0446\u0438\u044f showCloseAttack(&#8230;) \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u043a\u0430\u0440\u0442\u0443 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0431\u043e\u0439\u0446\u0430 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043d\u0430\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0443\u0440\u043e\u043d \u0432 \u0432\u0438\u0434\u0435 &#8216;X&#8217;.void Character::showCloseAttack(Character&amp; o) const{    system(&#171;cls&#187;);    for (int i = 0; i &lt; HEIGHT; i++)    {        for (int j = 0; j &lt; WIDTH; j++)        {            if (i == posY &amp;&amp; j == posX)            {                cout &lt;&lt; getAppearance();            }            else if (i == o.getPosY() &amp;&amp; j == o.getPosX())            {                cout &lt;&lt; &#8216;X&#8217;;            }            else cout &lt;&lt; MAP[i][j];        }        cout &lt;&lt; endl;    }}\u0424\u0443\u043d\u043a\u0446\u0438\u044f showRemoteAttack(&#8230;) \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0441\u043d\u0430\u0440\u044f\u0434\u0430 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043a\u0430\u0434\u0440\u0435. \u0421\u0430\u043c\u0430 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u0435\u0442\u0430 \u0441\u043d\u0430\u0440\u044f\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 animateRemoteAttack(&#8230;).void&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-480714","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/480714","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=480714"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/480714\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=480714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=480714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=480714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}