{"id":325077,"date":"2021-06-17T21:00:14","date_gmt":"2021-06-17T21:00:14","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=325077"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=325077","title":{"rendered":"\u0421\u0442\u0440\u0430\u043d\u043d\u044b\u0435 \u0448\u0430\u0445\u043c\u0430\u0442\u044b \u043a\u0430\u043a \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0414\u043e\u0431\u0440\u044b\u0439 \u0432\u0435\u0447\u0435\u0440 \u0445\u0430\u0431\u0440\u043e\u0436\u0438\u0442\u0435\u043b\u0438!<\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0443\u044e \u0441 \u043c\u043e\u0438\u043c\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c\u0438 \u0441\u0442\u0430\u0442\u044c\u044f\u043c\u0438. \u0413\u0434\u0435-\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0433\u043e\u0434\u0430 \u043d\u0430\u0437\u0430\u0434 \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0447\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443. \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043b \u044f \u0435\u0433\u043e \u0432 \u0441\u0440\u043e\u043a, \u043d\u043e \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0438 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u0437\u044f\u043b\u0438 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0434\u0435\u043b\u0430\u043b \u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 \u0438 \u043a\u0440\u0430\u0441\u043e\u0447\u043d\u0435\u0435.<\/p>\n<p>\u0421\u0443\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438, \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u043a\u0430 8 \u043d\u0430 8 \u043a\u043b\u0435\u0442\u043e\u043a. \u0423 \u0438\u0433\u0440\u043e\u043a\u0430 \u0435\u0441\u0442\u044c 9 \u0448\u0430\u0448\u0435\u043a \u043e\u043d\u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0432 \u0443\u0433\u043b\u0443 \u0434\u043e\u0441\u043a\u0438 \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0435  3 \u043d\u0430 3, \u0443 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430 \u0442\u043e\u0436\u0435 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0436\u0435 \u0448\u0430\u0448\u0435\u043a \u0438 \u043e\u043d\u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u043e \u043f\u043e \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0443\u0433\u043b\u0443 \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0435 3 \u043d\u0430 3. \u041a\u0430\u0436\u0434\u044b\u0439 \u0438\u0433\u0440\u043e\u043a \u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438, \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0439\u0442\u0438 \u0448\u0430\u0448\u043a\u0430\u043c\u0438 \u043d\u0430 \u043c\u0435\u0441\u0442\u0430 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u043e\u043f\u0435\u0440\u043d\u0438\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 \u0432\u0441\u044e \u0434\u043e\u0441\u043a\u0443, \u043a\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0434\u043e\u0448\u0435\u043b \u0442\u043e\u0442 \u0438 \u043f\u043e\u0431\u0435\u0434\u0438\u043b. \u0425\u043e\u0434\u0438\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043f\u0443\u0441\u0442\u044b\u0435 \u043a\u043b\u0435\u0442\u043a\u0438 \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0432\u0435\u0440\u0445, \u0432\u043d\u0438\u0437, \u0432\u043b\u0435\u0432\u043e \u0438 \u0432\u043f\u0440\u0430\u0432\u043e(\u043f\u043e \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438 \u043d\u0435\u043b\u044c\u0437\u044f!).<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dcf\/ef3\/8ce\/dcfef38ceee9769018841f3167de0ce1.png\" width=\"440\" height=\"315\"><figcaption><\/figcaption><\/figure>\n<p>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043c\u044b\u0448\u044c\u044e, \u0430 \u0438\u0433\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0442\u0438\u0432 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430. \u0427\u0435\u0440\u043d\u044b\u0435 &#8212; \u0447\u0435\u043b\u043e\u0432\u0435\u043a, \u0431\u0435\u043b\u044b\u0435 &#8212; \u0418\u0418.<\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0447\u0435\u0433\u043e \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u043a\u0443, \u0448\u0430\u0448\u043a\u0438 \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0441 \u043f\u043e\u043b\u0435\u043c.<\/p>\n<p>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"cpp\">Game::Game() { \trun = true;\/\/\u0444\u043b\u0430\u0433 \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438 \u0432\u044b\u0445\u043e\u0434\u0430 F5 \tMatrix = new int* [8];\/\/\u041f\u043e\u043b\u0435 64 \u044f\u0447\u0435\u0439\u043a\u0438 - \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f 0 - \u0434\u043b\u044f \u043f\u0443\u0441\u0442\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0438, \u0434\u043b\u044f \u0438\u0433\u0440\u043e\u043a\u0430 \u043a\u0430\u0436\u0434\u0430\u044f \u043f\u0435\u0448\u043a\u0430-\u0448\u0430\u0448\u043a\u0430 \u043e\u0442 1 \u0434\u043e 9, \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u043e\u0442 10 \u0434\u043e 18 \tfor (int i = 0; i &lt; 8; i++) \t\tMatrix[i] = new int[8]; \t\/\/\u041a\u0432\u0430\u0434\u0440\u0430\u0442\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043d\u0443\u0436\u043d\u044b \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0437\u043d\u0430\u043b\u0430 \u043a\u0430\u043a\u0438\u0435 \u044f\u0447\u0435\u0439\u043a\u0438 \u043d\u0430\u0434 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u043c \u043c\u044b\u0448\u0438, 64 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \tQuadCoorXleft = new int* [8];\/\/\u043a\u0430\u0436\u0434\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u044b Matrix \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0443\u0435\u0442 \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0434\u043b\u044f \u043c\u044b\u0448\u0438 xleft \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043b\u0435\u0432\u0443\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 x \tQuadCoorXright = new int* [8];\/\/xright - \u043f\u0440\u0430\u0432\u0430\u044f x \tQuadCoorYdown = new int* [8];\/\/\u0432\u0435\u0440\u0445\u043d\u044f\u044f y \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 \tQuadCoorYup = new int* [8];\/\/\u043d\u0438\u0436\u043d\u044f\u044f y \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 \tfor (int i = 0; i &lt; 8; i++) \t{ \t\tQuadCoorXleft[i] = new int[8]; \t\tQuadCoorXright[i] = new int[8]; \t\tQuadCoorYdown[i] = new int[8]; \t\tQuadCoorYup[i] = new int[8]; \t} \t\/\/\u041a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043f\u0435\u0448\u0435\u043a \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \tChessX = new double[18];\/\/X \tChessY = new double[18];\/\/Y \t\/\/\u0412\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u0430\u044f \u043f\u0435\u0448\u043a\u0430 \u0435\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \tActiveX = -1;\/\/X \tActiveY = -1;\/\/Y \tActive = -1;\/\/Value \tfirstplayer = true;\/\/\u0444\u043b\u0430\u0433 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0433\u0440\u043e\u043a 1\u0439 \u0445\u043e\u0434\u0438\u0442\u044c \tsecondplayer = false;\/\/\u0444\u043b\u0430\u0433 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0433\u0440\u043e\u043a 2\u0439 \u0445\u043e\u0434\u0438\u0442\u044c \tai = new bool[18];\/\/\u044f\u0447\u0435\u0439\u043a\u0438 \u0444\u043b\u0430\u0433\u0438 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043f\u0435\u0448\u043a\u0430 \u043d\u0430 \u0444\u0438\u043d\u0438\u0448\u043d\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \tchessai tmp; \tfor (int i = 0; i &lt; 18; i++) \t{ \t\tai[i] = false; \t\tif (i &gt; 8) \t\t{ \t\t\ttmp.ai = ai[i]; \t\t\ttmp.value = i+1; \t\t\tAi.push_back(tmp);\/\/\u0412\u0435\u043a\u0442\u043e\u0440 \u0441 \u0444\u043b\u0430\u0433\u0430\u043c\u0438 \u0444\u0438\u043d\u0438\u0448\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0435\u0448\u043a\u0438 \u0434\u043b\u044f \u0438\u0441\u043a\u0443\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0430 \t\t} \t} \taicountfirstrow = 0;\/\/\u0441\u0447\u0435\u0442\u0447\u0438\u043a \u043a\u043e\u043b-\u0432\u0430 \u043f\u0435\u0448\u0435\u043a \u0418\u0418(\u0438\u0441\u043a\u0443\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0430) \u043d\u0430 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435(0-\u044f) \taicountsecondrow = 0;\/\/\u0441\u0447\u0435\u0442\u0447\u0438\u043a \u043a\u043e\u043b-\u0432\u0430 \u043f\u0435\u0448\u0435\u043a \u0418\u0418 \u043d\u0430 \u043f\u0440\u0435\u0434\u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435(1-\u044f) \taicountthirdrow = 0;\/\/\u0441\u0447\u0435\u0442\u0447\u0438\u043a \u043a\u043e\u043b-\u0432\u0430 \u043f\u0435\u0448\u0435\u043a \u0418\u0418 \u043d\u0430 \u043f\u0440\u0435\u0434\u043f\u0440\u0435\u0434\u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435(2-\u044f) }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0438 \u0437\u0430\u0445\u0432\u0430\u0442\u0430 \u043c\u044b\u0448\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 OpenGL \u0438 SDL2.<\/p>\n<pre><code class=\"cpp\">void Draw_Circle() { \t\/\/\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u043a\u0440\u0443\u0433\u0430(\u043f\u0435\u0448\u0435\u043a-\u0448\u0430\u0445\u043c\u0430\u0442) \u0447\u0435\u0440\u043d\u043e\u0433\u043e \tfor (int i = 0; i &lt;= 50; i++) { \t\tfloat a = (float)i \/ 50.0f * 3.1415f * 2.0f; \t\tglVertex2f(cos(a), sin(a)); \t} } void Draw_Circle_Fill() { \t\/\/\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u043a\u0440\u0443\u0433\u0430(\u043f\u0435\u0448\u0435\u043a-\u0448\u0430\u0445\u043c\u0430\u0442) \u0431\u0435\u043b\u043e\u0433\u043e \tfor (int i = 0; i &lt;= 50; i++) { \t\tfloat a = (float)i \/ 50.0f * 3.1415f * 2.0f; \t\tglVertex2f(0.0, 0.0); \t\tglVertex2f(cos(a), sin(a)); \t} }<\/code><\/pre>\n<p>\u0421\u0430\u043c\u043e\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c glTranslatef \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u043e\u0441\u043a\u0443 \u0448\u0430\u0448\u043a\u0430\u043c\u0438 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f\u043c\u0438<\/p>\n<pre><code class=\"cpp\">... for (int i = 0; i &lt; 9; i++) \t\t{ \t\t\tglPushMatrix(); \t\t\tglTranslatef(ChessX[i], ChessY[i], 0); \t\t\tglScalef(0.05, 0.05, 1); \t\t\tglBegin(GL_LINE_LOOP); \t\t\tDraw_Circle(); \t\t\tglEnd(); \t\t\tglPopMatrix(); \t\t} \t\t\/\/\u0420\u0438\u0441\u0443\u0435\u043c \u0431\u0435\u043b\u044b\u0435 \u043f\u0435\u0448\u043a\u0438 \u0418\u0418 \t\tfor (int i = 9; i &lt; 18; i++) \t\t{ \t\t\tglPushMatrix(); \t\t\tglTranslatef(ChessX[i], ChessY[i], 0); \t\t\tglScalef(0.05, 0.05, 1); \t\t\tglBegin(GL_LINES); \t\t\tDraw_Circle_Fill(); \t\t\tglEnd(); \t\t\tglPopMatrix(); \t\t}  ...<\/code><\/pre>\n<p>\u0425\u043e\u0434\u044b \u0438\u0433\u0440\u043e\u043a\u0430:<\/p>\n<pre><code class=\"cpp\">void Game::Move_Up() { \t\/\/\u0425\u043e\u0434 \u0438\u0433\u0440\u043e\u043a\u0430 \u0432\u0432\u0435\u0440\u0445 \tif (Active &gt; 0 &amp;&amp; ActiveX != 0 &amp;&amp; Matrix[ActiveX-1][ActiveY] == 0)\/\/\u0415\u0441\u043b\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043f\u0435\u0448\u043a\u0430 \u0438 \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u0432\u0435\u0440\u0445\u043d\u044f\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0438 \u044f\u0447\u0435\u0439\u043a\u0430 \u0432\u044b\u0448\u0435 \u043f\u0443\u0441\u0442\u0430\u044f \t{ \t\tMatrix[ActiveX-1][ActiveY] = Matrix[ActiveX][ActiveY] ;\/\/\u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u044f\u0447\u0435\u0439\u043a\u0435 \u0432\u044b\u0448\u0435 \u0442\u0435\u043a\u0443\u0449\u044e\u044e(\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043f\u0435\u0448\u043a\u0443) \t\tMatrix[ActiveX][ActiveY] = 0;\/\/\u0437\u0430\u0442\u0438\u0440\u0430\u0435\u043c \u0441\u0442\u0430\u0440\u0443\u044e \u044f\u0447\u0435\u0439\u043a\u0443 \u043d\u0430 \u043f\u0443\u0441\u0442\u0443\u044e  \t\tChessY[Active-1] += 0.2;\/\/\u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 \u0423 \u043f\u0435\u0448\u043a\u0438 \u0432\u0432\u0435\u0440\u0445 \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \t\tActiveX = -1;\/\/\u0441\u0442\u0438\u0440\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0448\u043a\u0438 \t\tActiveY = -1;\/\/\u0441\u0442\u0438\u0440\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0448\u043a\u0438 \t\tActive = -1;\/\/\u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u0443 \t\tstd::cout &lt;&lt; \" Player MoveUp \" &lt;&lt; Active &lt;&lt; std::endl; \t\tfirstplayer = false; \t\tsecondplayer = true;\/\/\u043c\u0435\u043d\u044f\u0435\u043c \u0444\u043b\u0430\u0433\u0438 \u0445\u043e\u0434\u0430 \u043e\u0442 \u0438\u0433\u0440\u043e\u043a\u0430 \u043a \u0418\u0418 \t} } void Game::Move_Down() { \t\/\/\u0425\u043e\u0434 \u0438\u0433\u0440\u043e\u043a\u0430 \u0432\u043d\u0438\u0437 \tif (Active &gt; 0 &amp;&amp; ActiveX != 7 &amp;&amp; Matrix[ActiveX+1][ActiveY] == 0)\/\/\u0415\u0441\u043b\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043f\u0435\u0448\u043a\u0430 \u0438 \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u043d\u0438\u0436\u043d\u044f\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0438 \u044f\u0447\u0435\u0439\u043a\u0430 \u043d\u0438\u0436\u0435 \u043f\u0443\u0441\u0442\u0430\u044f \t{ \t\tMatrix[ActiveX+1][ActiveY] = Matrix[ActiveX][ActiveY] ;\/\/\u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u044f\u0447\u0435\u0439\u043a\u0435 \u043d\u0438\u0436\u0435 \u0442\u0435\u043a\u0443\u0449\u044e\u044e(\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043f\u0435\u0448\u043a\u0443) \t\tMatrix[ActiveX][ActiveY] = 0;\/\/\u0437\u0430\u0442\u0438\u0440\u0430\u0435\u043c \u0441\u0442\u0430\u0440\u0443\u044e \u044f\u0447\u0435\u0439\u043a\u0443 \u043d\u0430 \u043f\u0443\u0441\u0442\u0443\u044e  \t\tChessY[Active-1] -= 0.2;\/\/\u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 \u0423 \u043f\u0435\u0448\u043a\u0438 \u0432\u043d\u0438\u0437 \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \t\tActiveX = -1;\/\/\u0441\u0442\u0438\u0440\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0448\u043a\u0438 \t\tActiveY = -1;\/\/\u0441\u0442\u0438\u0440\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0448\u043a\u0438 \t\tActive = -1;\/\/\u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u0443 \t\tstd::cout &lt;&lt; \"Player MoveDown \" &lt;&lt; Active &lt;&lt; std::endl; \t\tfirstplayer = false; \t\tsecondplayer = true;\/\/\u043c\u0435\u043d\u044f\u0435\u043c \u0444\u043b\u0430\u0433\u0438 \u0445\u043e\u0434\u0430 \u043e\u0442 \u0438\u0433\u0440\u043e\u043a\u0430 \u043a \u0418\u0418 \t} } void Game::Move_Right() { \t\/\/\u0425\u043e\u0434 \u0438\u0433\u0440\u043e\u043a\u0430 \u0432\u043f\u0440\u0430\u0432\u043e \tif (Active &gt; 0 &amp;&amp; ActiveY != 7 &amp;&amp; Matrix[ActiveX][ActiveY+1] == 0)\/\/\u0415\u0441\u043b\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043f\u0435\u0448\u043a\u0430 \u0438 \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u043f\u0440\u0430\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0438 \u044f\u0447\u0435\u0439\u043a\u0430 \u0441\u043f\u0440\u0430\u0432\u0430 \u043f\u0443\u0441\u0442\u0430\u044f \t{ \t\tMatrix[ActiveX][ActiveY+1] = Matrix[ActiveX][ActiveY] ;\/\/\u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u044f\u0447\u0435\u0439\u043a\u0435 \u0441\u043f\u0440\u0430\u0432\u0430 \u0442\u0435\u043a\u0443\u0449\u044e\u044e(\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043f\u0435\u0448\u043a\u0443) \t\tMatrix[ActiveX][ActiveY] = 0;\/\/\u0437\u0430\u0442\u0438\u0440\u0430\u0435\u043c \u0441\u0442\u0430\u0440\u0443\u044e \u044f\u0447\u0435\u0439\u043a\u0443 \u043d\u0430 \u043f\u0443\u0441\u0442\u0443\u044e  \t\tChessX[Active-1] += 0.2;\/\/\u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 \u0425 \u043f\u0435\u0448\u043a\u0438 \u0432\u043f\u0440\u0430\u0432\u043e \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \t\tActiveX = -1;\/\/\u0441\u0442\u0438\u0440\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0448\u043a\u0438 \t\tActiveY = -1;\/\/\u0441\u0442\u0438\u0440\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0448\u043a\u0438 \t\tActive = -1;\/\/\u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u0443 \t\tstd::cout &lt;&lt; \"MoveRight \" &lt;&lt; Active &lt;&lt; std::endl; \t\tfirstplayer = false; \t\tsecondplayer = true;\/\/\u043c\u0435\u043d\u044f\u0435\u043c \u0444\u043b\u0430\u0433\u0438 \u0445\u043e\u0434\u0430 \u043e\u0442 \u0438\u0433\u0440\u043e\u043a\u0430 \u043a \u0418\u0418 \t} } void Game::Move_Left() { \t\/\/\u0425\u043e\u0434 \u0438\u0433\u0440\u043e\u043a\u0430 \u0432\u043b\u0435\u0432\u043e  \tif (Active &gt; 0 &amp;&amp; ActiveY != 0 &amp;&amp; Matrix[ActiveX][ActiveY-1] == 0)\/\/\u0415\u0441\u043b\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043f\u0435\u0448\u043a\u0430 \u0438 \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u043b\u0435\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0438 \u044f\u0447\u0435\u0439\u043a\u0430 \u0441\u043b\u0435\u0432\u0430 \u043f\u0443\u0441\u0442\u0430\u044f \t{ \t\tMatrix[ActiveX][ActiveY-1] = Matrix[ActiveX][ActiveY] ;\/\/\u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u044f\u0447\u0435\u0439\u043a\u0435 \u0441\u043b\u0435\u0432\u0430 \u0442\u0435\u043a\u0443\u0449\u044e\u044e(\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043f\u0435\u0448\u043a\u0443) \t\tMatrix[ActiveX][ActiveY] = 0;\/\/\u0437\u0430\u0442\u0438\u0440\u0430\u0435\u043c \u0441\u0442\u0430\u0440\u0443\u044e \u044f\u0447\u0435\u0439\u043a\u0443 \u043d\u0430 \u043f\u0443\u0441\u0442\u0443\u044e  \t\tChessX[Active-1] -= 0.2;\/\/\u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 \u0425 \u043f\u0435\u0448\u043a\u0438 \u0432\u043b\u0435\u0432\u043e \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \t\tActiveX = -1;\/\/\u0441\u0442\u0438\u0440\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0448\u043a\u0438 \t\tActiveY = -1;\/\/\u0441\u0442\u0438\u0440\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0448\u043a\u0438 \t\tActive = -1;\/\/\u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u0443 \t\tstd::cout &lt;&lt; \"MoveLeft \" &lt;&lt; Active &lt;&lt; std::endl; \t\tfirstplayer = false; \t\tsecondplayer = true;\/\/\u043c\u0435\u043d\u044f\u0435\u043c \u0444\u043b\u0430\u0433\u0438 \u0445\u043e\u0434\u0430 \u043e\u0442 \u0438\u0433\u0440\u043e\u043a\u0430 \u043a \u0418\u0418 \t} }<\/code><\/pre>\n<p>\u0425\u043e\u0434\u044b \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u043f\u043e\u0447\u0442\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b \u0445\u043e\u0434\u0430\u043c \u0438\u0433\u0440\u043e\u043a\u0430, \u0432 \u043a\u043e\u043d\u0446\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438\u0433\u0440\u044b, \u0435\u0441\u043b\u0438 \u043a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e.<\/p>\n<pre><code class=\"cpp\">void Game::ReccurentWalk() { \t\/\/\u0420\u0435\u043a\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u044b\u0439 \u0445\u043e\u0434 \u0418\u0418 \tcurrent = -1, currentI = -1, currentJ = -1;\/\/\u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043f\u0435\u0448\u043a\u0430 \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \tfor (int i = 0; i &lt; Ai.size(); i++)\/\/\u043f\u043e\u0438\u0441\u043a \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \t\tif (!Ai[i].ai)\/\/\u0435\u0441\u043b\u0438 \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u044b \u0445\u043e\u0434\u044b \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043f\u0435\u0448\u0435\u043a \t\t{ \t\t\tif (Check_MoveUp(Ai[i].value) || Check_MoveLeft(Ai[i].value))\/\/\u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u0432\u0432\u0435\u0440\u0445 \u0438\u043b\u0438 \u0432\u043b\u0435\u0432\u043e? \t\t\t{ \t\t\t\tcurrent = Ai[i].value;\/\/\u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043f\u0435\u0448\u043a\u0443 \t\t\t\tbreak; \t\t\t} \t\t\telse \t\t\t{ \t\t\t\t\/\/\u0415\u0441\u043b\u0438 \u043f\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u0442\u0438\u0440\u0430\u0435\u043c \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0445\u043e\u0434\u043e\u0432 \u043f\u0435\u0448\u043a\u0443 \t\t\t\tstd::vector&lt;chessai&gt;::iterator position = std::find_if(Ai.begin(), Ai.end(), find_s(Ai[i].value)); \t\t\t\tif (position != Ai.end()) \/\/ == vector.end() means the element was not found \t\t\t\t\tAi.erase(position); \t\t\t} \t\t} \tfor (int i = 0; i &lt; 8; i++) \t\tfor (int j = 0; j &lt; 8; j++) \t\t\tif (Matrix[i][j] == current)\/\/\u0438\u0449\u0435\u043c \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u043f\u0435\u0448\u043a\u0443 \u0438 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u044b \t\t\t{ \t\t\t\tcurrentI = i; \t\t\t\tcurrentJ = j; \t\t\t\tbreak; \t\t\t} \tif (currentI != -1 &amp;&amp; currentJ != -1)\/\/\u0435\u0441\u043b\u0438 \u043a\u0430\u043a\u0430\u044f \u043b\u0438\u0431\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u0445\u043e\u0434\u0438\u043c \u043b\u0438\u0431\u043e \u0432\u0432\u0435\u0440\u0445 \u043b\u0438\u0431\u043e \u0432\u043b\u0435\u0432\u043e \t{ \t\tif (!Move_UpAI(currentI, currentJ)) \t\t\tif (!Move_LeftAI(currentI, currentJ)) \t\t\t{ \t\t\t\tReccurentWalk(); \t\t\t} \t} \telse \t{ \t\t\/\/\u0435\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0445\u043e\u0434\u043e\u0432 \u0441\u043d\u043e\u0432\u0430 \u043f\u0435\u0448\u043a\u0430\u043c\u0438 \t\tchessai tmp; \t\tfor (int i = 0; i &lt; 18; i++) \t\t{ \t\t\tai[i] = false; \t\t\tif (i &gt; 8) \t\t\t{ \t\t\t\ttmp.ai = ai[i]; \t\t\t\ttmp.value = i + 1; \t\t\t\tAi.push_back(tmp); \t\t\t} \t\t} \t\t\/\/\u0438\u0449\u0435\u043c \u0442\u0443 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u0432\u043f\u0440\u0430\u0432\u043e \u0438\u043b\u0438 \u0432\u043d\u0438\u0437 \t\tfor (int i = 0; i &lt; Ai.size(); i++) \t\t\tif (!Ai[i].ai) \t\t\t{ \t\t\t\tif (Check_MoveRight(Ai[i].value) || Check_MoveDown(Ai[i].value)) \t\t\t\t{ \t\t\t\t\tcurrent = Ai[i].value; \t\t\t\t\tbreak; \t\t\t\t} \t\t\t\telse \t\t\t\t{ \t\t\t\t\t\/\/\u0435\u0441\u043b\u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0442\u043e \u0441\u0442\u0438\u0440\u0430\u0435\u043c \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \t\t\t\t\tstd::vector&lt;chessai&gt;::iterator position = std::find_if(Ai.begin(), Ai.end(), find_s(Ai[i].value)); \t\t\t\t\tif (position != Ai.end()) \/\/ == Vector.end() means the element was not found \t\t\t\t\t\tAi.erase(position); \t\t\t\t} \t\t\t} \t\t\/\/\u0438\u0449\u0435\u043c \u0435\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \t\tfor (int i = 0; i &lt; 8; i++) \t\t\tfor (int j = 0; j &lt; 8; j++) \t\t\t\tif (Matrix[i][j] == current) \t\t\t\t{ \t\t\t\t\tcurrentI = i; \t\t\t\t\tcurrentJ = j; \t\t\t\t\tbreak; \t\t\t\t} \t\t\/\/\u0445\u043e\u0434\u0438\u043c \u0432\u043f\u0440\u0430\u0432\u043e \u0438\u043b\u0438 \u0432\u043d\u0438\u0437 \t\tif(!Move_RightAI(currentI, currentJ)) \t\t\tif (!Move_DownAI(currentI, currentJ)) \t\t\t{ \t\t\t\tstd::cout &lt;&lt;\"Artificial Intellegence asked: WTF?\" &lt;&lt; std::endl; \t\t\t} \t} \tchessai tmp; \tif(Ai.empty())\/\/\u0435\u0441\u043b\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0445\u043e\u0434\u043e\u0432 \u043f\u0443\u0441\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043d\u043e\u0432\u0430 \u0432\u0441\u0435\u043c\u0438 \t\tfor (int i = 0; i &lt; 18; i++) \t\t{ \t\t\tai[i] = false; \t\t\tif (i &gt; 8) \t\t\t{ \t\t\t\ttmp.ai = ai[i]; \t\t\t\ttmp.value = i + 1; \t\t\t\tAi.push_back(tmp); \t\t\t} \t\t} }<\/code><\/pre>\n<p>\u041d\u0443 \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u043f\u0438\u0448\u0443 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0418\u0418. \u041e\u043d \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0442\u0440\u0438 \u043f\u0435\u0448\u043a\u0438 \u0432\u0432\u0435\u0440\u0445\u0443 \u043d\u0430 0-\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0438 \u0435\u0441\u043b\u0438 \u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f \u0432\u043b\u0435\u0432\u043e, \u0442\u043e \u0434\u0432\u0438\u0433\u0430\u0435\u0442 \u0432\u0432\u0435\u0440\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 3 \u043f\u0435\u0448\u043a\u0438 \u043d\u0430 1 \u0441\u0442\u0440\u043e\u043a\u0443, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0438 \u043d\u0430 2-\u044e \u0441\u0442\u0440\u043e\u043a\u0443. \u0415\u0441\u043b\u0438 \u0445\u043e\u0434\u0438\u0442\u044c \u0432\u043b\u0435\u0432\u043e \u0438 \u0432\u0432\u0435\u0440\u0445 \u043d\u0435\u043b\u044c\u0437\u044f, \u0442\u043e \u043e\u043d \u0431\u0435\u0440\u0435\u0442 \u043b\u044e\u0431\u0443\u044e \u0448\u0430\u0448\u043a\u0443 \u0438 \u0434\u0432\u0438\u0433\u0430\u0435\u0442 \u043b\u0438\u0431\u043e \u0432\u043d\u0438\u0437 \u043b\u0438\u0431\u043e \u0432\u043f\u0440\u0430\u0432\u043e \u0435\u0441\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0442\u043e \u0435\u0441\u0442\u044c \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u0432\u0438\u0433\u0430\u0442\u044c \u0432\u043b\u0435\u0432\u043e \u0438\u043b\u0438 \u0432\u0432\u0435\u0440\u0445( \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0447\u0442\u043e \u0432\u044b\u0448\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u0442\u0440\u0451\u0445 \u0448\u0430\u0448\u0435\u043a \u0432 \u0441\u0442\u0440\u043e\u043a\u0435).<\/p>\n<p>\u041d\u0443 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u0433\u0435\u0439\u043c\u043f\u043b\u0435\u0439:<\/p>\n<p><iframe id=\"60cbb1996f06c2a29f4b4555\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60cbb1996f06c2a29f4b4555\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p><a href=\"https:\/\/github.com\/Beginerok\/DominiGames\" rel=\"noopener noreferrer nofollow\">\u0418 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/a>.<\/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\/post\/563398\/\"> https:\/\/habr.com\/ru\/post\/563398\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0414\u043e\u0431\u0440\u044b\u0439 \u0432\u0435\u0447\u0435\u0440 \u0445\u0430\u0431\u0440\u043e\u0436\u0438\u0442\u0435\u043b\u0438!<\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0443\u044e \u0441 \u043c\u043e\u0438\u043c\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c\u0438 \u0441\u0442\u0430\u0442\u044c\u044f\u043c\u0438. \u0413\u0434\u0435-\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0433\u043e\u0434\u0430 \u043d\u0430\u0437\u0430\u0434 \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0447\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443. \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043b \u044f \u0435\u0433\u043e \u0432 \u0441\u0440\u043e\u043a, \u043d\u043e \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0438 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u0437\u044f\u043b\u0438 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0434\u0435\u043b\u0430\u043b \u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 \u0438 \u043a\u0440\u0430\u0441\u043e\u0447\u043d\u0435\u0435.<\/p>\n<p>\u0421\u0443\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438, \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u043a\u0430 8 \u043d\u0430 8 \u043a\u043b\u0435\u0442\u043e\u043a. \u0423 \u0438\u0433\u0440\u043e\u043a\u0430 \u0435\u0441\u0442\u044c 9 \u0448\u0430\u0448\u0435\u043a \u043e\u043d\u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0432 \u0443\u0433\u043b\u0443 \u0434\u043e\u0441\u043a\u0438 \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0435  3 \u043d\u0430 3, \u0443 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430 \u0442\u043e\u0436\u0435 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0436\u0435 \u0448\u0430\u0448\u0435\u043a \u0438 \u043e\u043d\u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u043e \u043f\u043e \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0443\u0433\u043b\u0443 \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0435 3 \u043d\u0430 3. \u041a\u0430\u0436\u0434\u044b\u0439 \u0438\u0433\u0440\u043e\u043a \u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438, \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0439\u0442\u0438 \u0448\u0430\u0448\u043a\u0430\u043c\u0438 \u043d\u0430 \u043c\u0435\u0441\u0442\u0430 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u043e\u043f\u0435\u0440\u043d\u0438\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 \u0432\u0441\u044e \u0434\u043e\u0441\u043a\u0443, \u043a\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0434\u043e\u0448\u0435\u043b \u0442\u043e\u0442 \u0438 \u043f\u043e\u0431\u0435\u0434\u0438\u043b. \u0425\u043e\u0434\u0438\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043f\u0443\u0441\u0442\u044b\u0435 \u043a\u043b\u0435\u0442\u043a\u0438 \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0432\u0435\u0440\u0445, \u0432\u043d\u0438\u0437, \u0432\u043b\u0435\u0432\u043e \u0438 \u0432\u043f\u0440\u0430\u0432\u043e(\u043f\u043e \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438 \u043d\u0435\u043b\u044c\u0437\u044f!).<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043c\u044b\u0448\u044c\u044e, \u0430 \u0438\u0433\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0442\u0438\u0432 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430. \u0427\u0435\u0440\u043d\u044b\u0435 &#8212; \u0447\u0435\u043b\u043e\u0432\u0435\u043a, \u0431\u0435\u043b\u044b\u0435 &#8212; \u0418\u0418.<\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0447\u0435\u0433\u043e \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u043a\u0443, \u0448\u0430\u0448\u043a\u0438 \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0441 \u043f\u043e\u043b\u0435\u043c.<\/p>\n<p>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"cpp\">Game::Game() { \trun = true;\/\/\u0444\u043b\u0430\u0433 \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438 \u0432\u044b\u0445\u043e\u0434\u0430 F5 \tMatrix = new int* [8];\/\/\u041f\u043e\u043b\u0435 64 \u044f\u0447\u0435\u0439\u043a\u0438 - \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f 0 - \u0434\u043b\u044f \u043f\u0443\u0441\u0442\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0438, \u0434\u043b\u044f \u0438\u0433\u0440\u043e\u043a\u0430 \u043a\u0430\u0436\u0434\u0430\u044f \u043f\u0435\u0448\u043a\u0430-\u0448\u0430\u0448\u043a\u0430 \u043e\u0442 1 \u0434\u043e 9, \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u043e\u0442 10 \u0434\u043e 18 \tfor (int i = 0; i &lt; 8; i++) \t\tMatrix[i] = new int[8]; \t\/\/\u041a\u0432\u0430\u0434\u0440\u0430\u0442\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043d\u0443\u0436\u043d\u044b \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0437\u043d\u0430\u043b\u0430 \u043a\u0430\u043a\u0438\u0435 \u044f\u0447\u0435\u0439\u043a\u0438 \u043d\u0430\u0434 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u043c \u043c\u044b\u0448\u0438, 64 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \tQuadCoorXleft = new int* [8];\/\/\u043a\u0430\u0436\u0434\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u044b Matrix \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0443\u0435\u0442 \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0434\u043b\u044f \u043c\u044b\u0448\u0438 xleft \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043b\u0435\u0432\u0443\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 x \tQuadCoorXright = new int* [8];\/\/xright - \u043f\u0440\u0430\u0432\u0430\u044f x \tQuadCoorYdown = new int* [8];\/\/\u0432\u0435\u0440\u0445\u043d\u044f\u044f y \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 \tQuadCoorYup = new int* [8];\/\/\u043d\u0438\u0436\u043d\u044f\u044f y \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 \tfor (int i = 0; i &lt; 8; i++) \t{ \t\tQuadCoorXleft[i] = new int[8]; \t\tQuadCoorXright[i] = new int[8]; \t\tQuadCoorYdown[i] = new int[8]; \t\tQuadCoorYup[i] = new int[8]; \t} \t\/\/\u041a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043f\u0435\u0448\u0435\u043a \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \tChessX = new double[18];\/\/X \tChessY = new double[18];\/\/Y \t\/\/\u0412\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u0430\u044f \u043f\u0435\u0448\u043a\u0430 \u0435\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \tActiveX = -1;\/\/X \tActiveY = -1;\/\/Y \tActive = -1;\/\/Value \tfirstplayer = true;\/\/\u0444\u043b\u0430\u0433 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0433\u0440\u043e\u043a 1\u0439 \u0445\u043e\u0434\u0438\u0442\u044c \tsecondplayer = false;\/\/\u0444\u043b\u0430\u0433 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0433\u0440\u043e\u043a 2\u0439 \u0445\u043e\u0434\u0438\u0442\u044c \tai = new bool[18];\/\/\u044f\u0447\u0435\u0439\u043a\u0438 \u0444\u043b\u0430\u0433\u0438 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043f\u0435\u0448\u043a\u0430 \u043d\u0430 \u0444\u0438\u043d\u0438\u0448\u043d\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \tchessai tmp; \tfor (int i = 0; i &lt; 18; i++) \t{ \t\tai[i] = false; \t\tif (i &gt; 8) \t\t{ \t\t\ttmp.ai = ai[i]; \t\t\ttmp.value = i+1; \t\t\tAi.push_back(tmp);\/\/\u0412\u0435\u043a\u0442\u043e\u0440 \u0441 \u0444\u043b\u0430\u0433\u0430\u043c\u0438 \u0444\u0438\u043d\u0438\u0448\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0435\u0448\u043a\u0438 \u0434\u043b\u044f \u0438\u0441\u043a\u0443\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0430 \t\t} \t} \taicountfirstrow = 0;\/\/\u0441\u0447\u0435\u0442\u0447\u0438\u043a \u043a\u043e\u043b-\u0432\u0430 \u043f\u0435\u0448\u0435\u043a \u0418\u0418(\u0438\u0441\u043a\u0443\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0430) \u043d\u0430 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435(0-\u044f) \taicountsecondrow = 0;\/\/\u0441\u0447\u0435\u0442\u0447\u0438\u043a \u043a\u043e\u043b-\u0432\u0430 \u043f\u0435\u0448\u0435\u043a \u0418\u0418 \u043d\u0430 \u043f\u0440\u0435\u0434\u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435(1-\u044f) \taicountthirdrow = 0;\/\/\u0441\u0447\u0435\u0442\u0447\u0438\u043a \u043a\u043e\u043b-\u0432\u0430 \u043f\u0435\u0448\u0435\u043a \u0418\u0418 \u043d\u0430 \u043f\u0440\u0435\u0434\u043f\u0440\u0435\u0434\u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435(2-\u044f) }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0438 \u0437\u0430\u0445\u0432\u0430\u0442\u0430 \u043c\u044b\u0448\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 OpenGL \u0438 SDL2.<\/p>\n<pre><code class=\"cpp\">void Draw_Circle() { \t\/\/\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u043a\u0440\u0443\u0433\u0430(\u043f\u0435\u0448\u0435\u043a-\u0448\u0430\u0445\u043c\u0430\u0442) \u0447\u0435\u0440\u043d\u043e\u0433\u043e \tfor (int i = 0; i &lt;= 50; i++) { \t\tfloat a = (float)i \/ 50.0f * 3.1415f * 2.0f; \t\tglVertex2f(cos(a), sin(a)); \t} } void Draw_Circle_Fill() { \t\/\/\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u043a\u0440\u0443\u0433\u0430(\u043f\u0435\u0448\u0435\u043a-\u0448\u0430\u0445\u043c\u0430\u0442) \u0431\u0435\u043b\u043e\u0433\u043e \tfor (int i = 0; i &lt;= 50; i++) { \t\tfloat a = (float)i \/ 50.0f * 3.1415f * 2.0f; \t\tglVertex2f(0.0, 0.0); \t\tglVertex2f(cos(a), sin(a)); \t} }<\/code><\/pre>\n<p>\u0421\u0430\u043c\u043e\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c glTranslatef \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u043e\u0441\u043a\u0443 \u0448\u0430\u0448\u043a\u0430\u043c\u0438 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f\u043c\u0438<\/p>\n<pre><code class=\"cpp\">... for (int i = 0; i &lt; 9; i++) \t\t{ \t\t\tglPushMatrix(); \t\t\tglTranslatef(ChessX[i], ChessY[i], 0); \t\t\tglScalef(0.05, 0.05, 1); \t\t\tglBegin(GL_LINE_LOOP); \t\t\tDraw_Circle(); \t\t\tglEnd(); \t\t\tglPopMatrix(); \t\t} \t\t\/\/\u0420\u0438\u0441\u0443\u0435\u043c \u0431\u0435\u043b\u044b\u0435 \u043f\u0435\u0448\u043a\u0438 \u0418\u0418 \t\tfor (int i = 9; i &lt; 18; i++) \t\t{ \t\t\tglPushMatrix(); \t\t\tglTranslatef(ChessX[i], ChessY[i], 0); \t\t\tglScalef(0.05, 0.05, 1); \t\t\tglBegin(GL_LINES); \t\t\tDraw_Circle_Fill(); \t\t\tglEnd(); \t\t\tglPopMatrix(); \t\t}  ...<\/code><\/pre>\n<p>\u0425\u043e\u0434\u044b \u0438\u0433\u0440\u043e\u043a\u0430:<\/p>\n<pre><code class=\"cpp\">void Game::Move_Up() { \t\/\/\u0425\u043e\u0434 \u0438\u0433\u0440\u043e\u043a\u0430 \u0432\u0432\u0435\u0440\u0445 \tif (Active &gt; 0 &amp;&amp; ActiveX != 0 &amp;&amp; Matrix[ActiveX-1][ActiveY] == 0)\/\/\u0415\u0441\u043b\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043f\u0435\u0448\u043a\u0430 \u0438 \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u0432\u0435\u0440\u0445\u043d\u044f\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0438 \u044f\u0447\u0435\u0439\u043a\u0430 \u0432\u044b\u0448\u0435 \u043f\u0443\u0441\u0442\u0430\u044f \t{ \t\tMatrix[ActiveX-1][ActiveY] = Matrix[ActiveX][ActiveY] ;\/\/\u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u044f\u0447\u0435\u0439\u043a\u0435 \u0432\u044b\u0448\u0435 \u0442\u0435\u043a\u0443\u0449\u044e\u044e(\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043f\u0435\u0448\u043a\u0443) \t\tMatrix[ActiveX][ActiveY] = 0;\/\/\u0437\u0430\u0442\u0438\u0440\u0430\u0435\u043c \u0441\u0442\u0430\u0440\u0443\u044e \u044f\u0447\u0435\u0439\u043a\u0443 \u043d\u0430 \u043f\u0443\u0441\u0442\u0443\u044e  \t\tChessY[Active-1] += 0.2;\/\/\u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 \u0423 \u043f\u0435\u0448\u043a\u0438 \u0432\u0432\u0435\u0440\u0445 \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \t\tActiveX = -1;\/\/\u0441\u0442\u0438\u0440\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0448\u043a\u0438 \t\tActiveY = -1;\/\/\u0441\u0442\u0438\u0440\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0448\u043a\u0438 \t\tActive = -1;\/\/\u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u0443 \t\tstd::cout &lt;&lt; \" Player MoveUp \" &lt;&lt; Active &lt;&lt; std::endl; \t\tfirstplayer = false; \t\tsecondplayer = true;\/\/\u043c\u0435\u043d\u044f\u0435\u043c \u0444\u043b\u0430\u0433\u0438 \u0445\u043e\u0434\u0430 \u043e\u0442 \u0438\u0433\u0440\u043e\u043a\u0430 \u043a \u0418\u0418 \t} } void Game::Move_Down() { \t\/\/\u0425\u043e\u0434 \u0438\u0433\u0440\u043e\u043a\u0430 \u0432\u043d\u0438\u0437 \tif (Active &gt; 0 &amp;&amp; ActiveX != 7 &amp;&amp; Matrix[ActiveX+1][ActiveY] == 0)\/\/\u0415\u0441\u043b\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043f\u0435\u0448\u043a\u0430 \u0438 \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u043d\u0438\u0436\u043d\u044f\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0438 \u044f\u0447\u0435\u0439\u043a\u0430 \u043d\u0438\u0436\u0435 \u043f\u0443\u0441\u0442\u0430\u044f \t{ \t\tMatrix[ActiveX+1][ActiveY] = Matrix[ActiveX][ActiveY] ;\/\/\u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u044f\u0447\u0435\u0439\u043a\u0435 \u043d\u0438\u0436\u0435 \u0442\u0435\u043a\u0443\u0449\u044e\u044e(\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043f\u0435\u0448\u043a\u0443) \t\tMatrix[ActiveX][ActiveY] = 0;\/\/\u0437\u0430\u0442\u0438\u0440\u0430\u0435\u043c \u0441\u0442\u0430\u0440\u0443\u044e \u044f\u0447\u0435\u0439\u043a\u0443 \u043d\u0430 \u043f\u0443\u0441\u0442\u0443\u044e  \t\tChessY[Active-1] -= 0.2;\/\/\u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 \u0423 \u043f\u0435\u0448\u043a\u0438 \u0432\u043d\u0438\u0437 \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \t\tActiveX = -1;\/\/\u0441\u0442\u0438\u0440\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0448\u043a\u0438 \t\tActiveY = -1;\/\/\u0441\u0442\u0438\u0440\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0448\u043a\u0438 \t\tActive = -1;\/\/\u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u0443 \t\tstd::cout &lt;&lt; \"Player MoveDown \" &lt;&lt; Active &lt;&lt; std::endl; \t\tfirstplayer = false; \t\tsecondplayer = true;\/\/\u043c\u0435\u043d\u044f\u0435\u043c \u0444\u043b\u0430\u0433\u0438 \u0445\u043e\u0434\u0430 \u043e\u0442 \u0438\u0433\u0440\u043e\u043a\u0430 \u043a \u0418\u0418 \t} } void Game::Move_Right() { \t\/\/\u0425\u043e\u0434 \u0438\u0433\u0440\u043e\u043a\u0430 \u0432\u043f\u0440\u0430\u0432\u043e \tif (Active &gt; 0 &amp;&amp; ActiveY != 7 &amp;&amp; Matrix[ActiveX][ActiveY+1] == 0)\/\/\u0415\u0441\u043b\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043f\u0435\u0448\u043a\u0430 \u0438 \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u043f\u0440\u0430\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0438 \u044f\u0447\u0435\u0439\u043a\u0430 \u0441\u043f\u0440\u0430\u0432\u0430 \u043f\u0443\u0441\u0442\u0430\u044f \t{ \t\tMatrix[ActiveX][ActiveY+1] = Matrix[ActiveX][ActiveY] ;\/\/\u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u044f\u0447\u0435\u0439\u043a\u0435 \u0441\u043f\u0440\u0430\u0432\u0430 \u0442\u0435\u043a\u0443\u0449\u044e\u044e(\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043f\u0435\u0448\u043a\u0443) \t\tMatrix[ActiveX][ActiveY] = 0;\/\/\u0437\u0430\u0442\u0438\u0440\u0430\u0435\u043c \u0441\u0442\u0430\u0440\u0443\u044e \u044f\u0447\u0435\u0439\u043a\u0443 \u043d\u0430 \u043f\u0443\u0441\u0442\u0443\u044e  \t\tChessX[Active-1] += 0.2;\/\/\u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 \u0425 \u043f\u0435\u0448\u043a\u0438 \u0432\u043f\u0440\u0430\u0432\u043e \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \t\tActiveX = -1;\/\/\u0441\u0442\u0438\u0440\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0448\u043a\u0438 \t\tActiveY = -1;\/\/\u0441\u0442\u0438\u0440\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0448\u043a\u0438 \t\tActive = -1;\/\/\u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u0443 \t\tstd::cout &lt;&lt; \"MoveRight \" &lt;&lt; Active &lt;&lt; std::endl; \t\tfirstplayer = false; \t\tsecondplayer = true;\/\/\u043c\u0435\u043d\u044f\u0435\u043c \u0444\u043b\u0430\u0433\u0438 \u0445\u043e\u0434\u0430 \u043e\u0442 \u0438\u0433\u0440\u043e\u043a\u0430 \u043a \u0418\u0418 \t} } void Game::Move_Left() { \t\/\/\u0425\u043e\u0434 \u0438\u0433\u0440\u043e\u043a\u0430 \u0432\u043b\u0435\u0432\u043e  \tif (Active &gt; 0 &amp;&amp; ActiveY != 0 &amp;&amp; Matrix[ActiveX][ActiveY-1] == 0)\/\/\u0415\u0441\u043b\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043f\u0435\u0448\u043a\u0430 \u0438 \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u043b\u0435\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0438 \u044f\u0447\u0435\u0439\u043a\u0430 \u0441\u043b\u0435\u0432\u0430 \u043f\u0443\u0441\u0442\u0430\u044f \t{ \t\tMatrix[ActiveX][ActiveY-1] = Matrix[ActiveX][ActiveY] ;\/\/\u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u044f\u0447\u0435\u0439\u043a\u0435 \u0441\u043b\u0435\u0432\u0430 \u0442\u0435\u043a\u0443\u0449\u044e\u044e(\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043f\u0435\u0448\u043a\u0443) \t\tMatrix[ActiveX][ActiveY] = 0;\/\/\u0437\u0430\u0442\u0438\u0440\u0430\u0435\u043c \u0441\u0442\u0430\u0440\u0443\u044e \u044f\u0447\u0435\u0439\u043a\u0443 \u043d\u0430 \u043f\u0443\u0441\u0442\u0443\u044e  \t\tChessX[Active-1] -= 0.2;\/\/\u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 \u0425 \u043f\u0435\u0448\u043a\u0438 \u0432\u043b\u0435\u0432\u043e \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \t\tActiveX = -1;\/\/\u0441\u0442\u0438\u0440\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0448\u043a\u0438 \t\tActiveY = -1;\/\/\u0441\u0442\u0438\u0440\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0448\u043a\u0438 \t\tActive = -1;\/\/\u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u0443 \t\tstd::cout &lt;&lt; \"MoveLeft \" &lt;&lt; Active &lt;&lt; std::endl; \t\tfirstplayer = false; \t\tsecondplayer = true;\/\/\u043c\u0435\u043d\u044f\u0435\u043c \u0444\u043b\u0430\u0433\u0438 \u0445\u043e\u0434\u0430 \u043e\u0442 \u0438\u0433\u0440\u043e\u043a\u0430 \u043a \u0418\u0418 \t} }<\/code><\/pre>\n<p>\u0425\u043e\u0434\u044b \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u043f\u043e\u0447\u0442\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b \u0445\u043e\u0434\u0430\u043c \u0438\u0433\u0440\u043e\u043a\u0430, \u0432 \u043a\u043e\u043d\u0446\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438\u0433\u0440\u044b, \u0435\u0441\u043b\u0438 \u043a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e.<\/p>\n<pre><code class=\"cpp\">void Game::ReccurentWalk() { \t\/\/\u0420\u0435\u043a\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u044b\u0439 \u0445\u043e\u0434 \u0418\u0418 \tcurrent = -1, currentI = -1, currentJ = -1;\/\/\u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043f\u0435\u0448\u043a\u0430 \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \tfor (int i = 0; i &lt; Ai.size(); i++)\/\/\u043f\u043e\u0438\u0441\u043a \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \t\tif (!Ai[i].ai)\/\/\u0435\u0441\u043b\u0438 \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u044b \u0445\u043e\u0434\u044b \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043f\u0435\u0448\u0435\u043a \t\t{ \t\t\tif (Check_MoveUp(Ai[i].value) || Check_MoveLeft(Ai[i].value))\/\/\u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u0432\u0432\u0435\u0440\u0445 \u0438\u043b\u0438 \u0432\u043b\u0435\u0432\u043e? \t\t\t{ \t\t\t\tcurrent = Ai[i].value;\/\/\u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043f\u0435\u0448\u043a\u0443 \t\t\t\tbreak; \t\t\t} \t\t\telse \t\t\t{ \t\t\t\t\/\/\u0415\u0441\u043b\u0438 \u043f\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u0442\u0438\u0440\u0430\u0435\u043c \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0445\u043e\u0434\u043e\u0432 \u043f\u0435\u0448\u043a\u0443 \t\t\t\tstd::vector&lt;chessai&gt;::iterator position = std::find_if(Ai.begin(), Ai.end(), find_s(Ai[i].value)); \t\t\t\tif (position != Ai.end()) \/\/ == vector.end() means the element was not found \t\t\t\t\tAi.erase(position); \t\t\t} \t\t} \tfor (int i = 0; i &lt; 8; i++) \t\tfor (int j = 0; j &lt; 8; j++) \t\t\tif (Matrix[i][j] == current)\/\/\u0438\u0449\u0435\u043c \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u043f\u0435\u0448\u043a\u0443 \u0438 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u044b \t\t\t{ \t\t\t\tcurrentI = i; \t\t\t\tcurrentJ = j; \t\t\t\tbreak; \t\t\t} \tif (currentI != -1 &amp;&amp; currentJ != -1)\/\/\u0435\u0441\u043b\u0438 \u043a\u0430\u043a\u0430\u044f \u043b\u0438\u0431\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u0445\u043e\u0434\u0438\u043c \u043b\u0438\u0431\u043e \u0432\u0432\u0435\u0440\u0445 \u043b\u0438\u0431\u043e \u0432\u043b\u0435\u0432\u043e \t{ \t\tif (!Move_UpAI(currentI, currentJ)) \t\t\tif (!Move_LeftAI(currentI, currentJ)) \t\t\t{ \t\t\t\tReccurentWalk(); \t\t\t} \t} \telse \t{ \t\t\/\/\u0435\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0445\u043e\u0434\u043e\u0432 \u0441\u043d\u043e\u0432\u0430 \u043f\u0435\u0448\u043a\u0430\u043c\u0438 \t\tchessai tmp; \t\tfor (int i = 0; i &lt; 18; i++) \t\t{ \t\t\tai[i] = false; \t\t\tif (i &gt; 8) \t\t\t{ \t\t\t\ttmp.ai = ai[i]; \t\t\t\ttmp.value = i + 1; \t\t\t\tAi.push_back(tmp); \t\t\t} \t\t} \t\t\/\/\u0438\u0449\u0435\u043c \u0442\u0443 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u0432\u043f\u0440\u0430\u0432\u043e \u0438\u043b\u0438 \u0432\u043d\u0438\u0437 \t\tfor (int i = 0; i &lt; Ai.size(); i++) \t\t\tif (!Ai[i].ai) \t\t\t{ \t\t\t\tif (Check_MoveRight(Ai[i].value) || Check_MoveDown(Ai[i].value)) \t\t\t\t{ \t\t\t\t\tcurrent = Ai[i].value; \t\t\t\t\tbreak; \t\t\t\t} \t\t\t\telse \t\t\t\t{ \t\t\t\t\t\/\/\u0435\u0441\u043b\u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0442\u043e \u0441\u0442\u0438\u0440\u0430\u0435\u043c \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \t\t\t\t\tstd::vector&lt;chessai&gt;::iterator position = std::find_if(Ai.begin(), Ai.end(), find_s(Ai[i].value)); \t\t\t\t\tif (position != Ai.end()) \/\/ == Vector.end() means the element was not found \t\t\t\t\t\tAi.erase(position); \t\t\t\t} \t\t\t} \t\t\/\/\u0438\u0449\u0435\u043c \u0435\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \t\tfor (int i = 0; i &lt; 8; i++) \t\t\tfor (int j = 0; j &lt; 8; j++) \t\t\t\tif (Matrix[i][j] == current) \t\t\t\t{ \t\t\t\t\tcurrentI = i; \t\t\t\t\tcurrentJ = j; \t\t\t\t\tbreak; \t\t\t\t} \t\t\/\/\u0445\u043e\u0434\u0438\u043c \u0432\u043f\u0440\u0430\u0432\u043e \u0438\u043b\u0438 \u0432\u043d\u0438\u0437 \t\tif(!Move_RightAI(currentI, currentJ)) \t\t\tif (!Move_DownAI(currentI, currentJ)) \t\t\t{ \t\t\t\tstd::cout &lt;&lt;\"Artificial Intellegence asked: WTF?\" &lt;&lt; std::endl; \t\t\t} \t} \tchessai tmp; \tif(Ai.empty())\/\/\u0435\u0441\u043b\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0445\u043e\u0434\u043e\u0432 \u043f\u0443\u0441\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043d\u043e\u0432\u0430 \u0432\u0441\u0435\u043c\u0438 \t\tfor (int i = 0; i &lt; 18; i++) \t\t{ \t\t\tai[i] = false; \t\t\tif (i &gt; 8) \t\t\t{ \t\t\t\ttmp.ai = ai[i]; \t\t\t\ttmp.value = i + 1; \t\t\t\tAi.push_back(tmp); \t\t\t} \t\t} }<\/code><\/pre>\n<p>\u041d\u0443 \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u043f\u0438\u0448\u0443 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0418\u0418. \u041e\u043d \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0442\u0440\u0438 \u043f\u0435\u0448\u043a\u0438 \u0432\u0432\u0435\u0440\u0445\u0443 \u043d\u0430 0-\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0438 \u0435\u0441\u043b\u0438 \u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f \u0432\u043b\u0435\u0432\u043e, \u0442\u043e \u0434\u0432\u0438\u0433\u0430\u0435\u0442 \u0432\u0432\u0435\u0440\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 3 \u043f\u0435\u0448\u043a\u0438 \u043d\u0430 1 \u0441\u0442\u0440\u043e\u043a\u0443, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0438 \u043d\u0430 2-\u044e \u0441\u0442\u0440\u043e\u043a\u0443. \u0415\u0441\u043b\u0438 \u0445\u043e\u0434\u0438\u0442\u044c \u0432\u043b\u0435\u0432\u043e \u0438 \u0432\u0432\u0435\u0440\u0445 \u043d\u0435\u043b\u044c\u0437\u044f, \u0442\u043e \u043e\u043d \u0431\u0435\u0440\u0435\u0442 \u043b\u044e\u0431\u0443\u044e \u0448\u0430\u0448\u043a\u0443 \u0438 \u0434\u0432\u0438\u0433\u0430\u0435\u0442 \u043b\u0438\u0431\u043e \u0432\u043d\u0438\u0437 \u043b\u0438\u0431\u043e \u0432\u043f\u0440\u0430\u0432\u043e \u0435\u0441\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0442\u043e \u0435\u0441\u0442\u044c \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u0432\u0438\u0433\u0430\u0442\u044c \u0432\u043b\u0435\u0432\u043e \u0438\u043b\u0438 \u0432\u0432\u0435\u0440\u0445( \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0447\u0442\u043e \u0432\u044b\u0448\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u0442\u0440\u0451\u0445 \u0448\u0430\u0448\u0435\u043a \u0432 \u0441\u0442\u0440\u043e\u043a\u0435).<\/p>\n<p>\u041d\u0443 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u0433\u0435\u0439\u043c\u043f\u043b\u0435\u0439:<\/p>\n<p><iframe id=\"60cbb1996f06c2a29f4b4555\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60cbb1996f06c2a29f4b4555\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p><a href=\"https:\/\/github.com\/Beginerok\/DominiGames\" rel=\"noopener noreferrer nofollow\">\u0418 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/a>.<\/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\/post\/563398\/\"> https:\/\/habr.com\/ru\/post\/563398\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-325077","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/325077","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=325077"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/325077\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=325077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=325077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=325077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}