{"id":207964,"date":"2014-01-11T21:01:03","date_gmt":"2014-01-11T17:01:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=207964"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=207964","title":{"rendered":"<span class=\"post_title\">\u0418\u0433\u0440\u0430 \u0432 30 \u043a\u043e\u043c\u0430\u043d\u0434 \u0410\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0433\u043e\u0434\u0443 \u0431\u044b\u043b\u0438 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b \u0442\u0435\u043c\u044b, \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0437\u0430 30 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430. \u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0431\u044b\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u043d\u044b \u043d\u0430 JavaScript. \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0431 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430, \u043d\u043e \u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u0440\u0430\u0437\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u044f\u0434\u0440\u043e \u041e\u0421 \u043d\u0430\u043a\u043e\u043d\u0435\u0446. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043d\u0435 30 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430, \u0430 \u0434\u0435\u0441\u044f\u0442\u043a\u0438, \u0441\u043e\u0442\u043d\u0438 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0435\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430.<br \/>  \u0410 \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0437\u0430 30 \u0441\u0442\u0440\u043e\u043a \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430, \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442 \u041e\u0421?<br \/>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043e\u043f\u0438\u0448\u0443, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0440\u0435\u0441\u0442\u0438\u043a\u0438-\u043d\u043e\u043b\u0438\u043a\u0438 \u0437\u0430 30 \u0441\u0442\u0440\u043e\u043a \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0417\u0430\u0434\u0430\u0447\u0430: \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0438\u0433\u0440\u0443 \u043a\u0440\u0435\u0441\u0442\u0438\u043a\u0438-\u043d\u043e\u043b\u0438\u043a\u0438.<br \/>  \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u00ab\u0438\u0433\u0440\u044b\u00bb:  <\/p>\n<ul>\n<li>\u0434\u043e 30 \u0441\u0442\u0440\u043e\u043a \u0447\u0438\u0441\u0442\u044b\u0445 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434. \u0411\u0435\u0437 \u0436\u0443\u043b\u044c\u043d\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0443 db &#8230;&#8230;<\/li>\n<li>\u041d\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 \u0434\u0430\u043d\u043d\u044b\u0445. <a href=\"http:\/\/habrahabr.ru\/post\/203048\/\">\u0418\u0433\u0440\u0430 \u0432 0 \u0441\u0442\u0440\u043e\u043a JS<\/a> \u0438\u043c\u0435\u043b\u0430 \u043d\u0435 \u043c\u0430\u043b\u043e \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0432\u0438\u0434\u0435 HTML \u0438 CSS<\/li>\n<li>\u041d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043b\u0443\u0447\u0448\u0435 \u0431\u0435\u0437 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u041e\u0421, \u0442\u043e\u043b\u044c\u043a\u043e BIOS<\/li>\n<li>\u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c<\/li>\n<\/ul>\n<p>  \u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430 30 \u0441\u0442\u0440\u043e\u043a \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0446\u0438\u043a\u043b \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a (\u043a\u043e\u043c\u0430\u043d\u0434). \u041a\u0430\u0436\u0434\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u2014 \u044d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a \u043d\u0443\u0436\u043d\u043e \u043d\u0430 \u0446\u0438\u043a\u043b\u044b, \u0434\u043b\u044f \u0442\u0435\u0445 \u043a\u0442\u043e \u043f\u043b\u043e\u0445\u043e \u0437\u043d\u0430\u0435\u0442 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">\/\/ \u041d\u0430 C++ for ( int i=0; i&lt;100; i++)...;  _asm { \/\/ \u041d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435 mov ecx,0 ; int i=0 labelForI:   ... inc ecx ;i++ cmp ecx,100 ;i&lt;100 jna labelForI  \/\/ \u0415\u0441\u043b\u0438 \u0434\u043b\u0438\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445 \u0431\u043e\u043b\u044c\u0448\u0435 127 \u043c\u0435\u0436\u0434\u0443 \u043c\u0435\u0442\u043a\u0430\u043c\u0438, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u0438\u043d\u043d\u044b\u0439 jmp, \u0435\u0441\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0446\u0438\u043a\u043b\u0430 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440 ecx, \u0442\u043e \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0438 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c... mov ecx,0 ; int i=0 labelForI:  push ecx   ...  pop ecx  inc ecx ;i++ cmp ecx,99 ;i&lt;100 ja labelEndFor jmp labelForI labelEndFor:  \/\/ \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0432 \u043b\u0443\u0447\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u0435\u0435. mov ecx,100 ; int i=100 labelForI:   ... dec ecx ;i-- jnz labelForI  \/\/ \u0435\u0449\u0451 \u043c\u0435\u043d\u044c\u0448\u0435 mov ecx,100 ; int i=100 labelForI: nop ; nop - \u043a\u043e\u043c\u0430\u043d\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 loop labelForI  \/\/ \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0436\u0443\u043b\u044c\u043d\u0438\u0447\u0430\u0442\u044c, \u0437\u0430\u043f\u0438\u0441\u0430\u0432 \u0432\u0441\u0451 \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0443. DB B9h,00,01,00,00,90h,E2h,F8h ; \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 99 \u0440\u0430\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 nop (90h), \u0442\u0435. \u0431\u0435\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u0430\u043c\u0430\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u0440\u0435\u0441\u0442\u0438\u043a\u043e\u0432-\u043d\u043e\u043b\u0438\u043a\u043e\u0432 \u2014 \u044d\u0442\u043e \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043a\u043b\u0435\u0442\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0432 \u0446\u0438\u043a\u043b\u0430\u0445 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0431\u0435\u0434\u044b, \u0432 \u0446\u0438\u043a\u043b\u0430\u0445 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d. \u041f\u043e \u044d\u0442\u043e\u043c\u0443 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0433\u0440\u0443 \u0437\u0430 30 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0435\u0440\u0435\u0430\u043b\u044c\u043d\u043e.<\/p>\n<h4>\u041f\u0435\u0440\u0432\u0430\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u2014 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/h4>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0435\u0441\u043b\u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0433\u0440\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0430 \u0443\u0436 \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b, \u0442\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0446\u0438\u043a\u043b\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u043e\u0431\u0435\u0434\u0443. \u041c\u043e\u0436\u043d\u043e \u0432\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432\u0441\u0451 \u0438\u0433\u0440\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435, \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 3 \u043d\u0430 3 (\u0445\u0432\u0430\u0442\u0438\u0442 \u0438 \u043d\u0430 4*4) \u0432 4 \u0431\u0430\u0439\u0442\u0430, \u0438\u043b\u0438 2 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0445 \u0441\u043b\u043e\u0432\u0430, \u043f\u043e \u0434\u0432\u0430 \u0431\u0430\u0439\u0442\u0430 \u043d\u0430 \u0438\u0433\u0440\u043e\u043a\u0430. \u0422\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u043e\u0431\u0435\u0434\u044b \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u043e\u043c \u0432\u043e\u0441\u044c\u043c\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c \u043f\u043e\u0431\u0435\u0434\u044b, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0432 \u0432\u0438\u0434\u0435 \u0432\u043e\u0441\u044c\u043c\u0438 \u0447\u0438\u0441\u0435\u043b (\u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044f \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f \u0431\u0438\u0442 \u0441 int map_x, int map_0).<br \/>  \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438\u0434\u0435\u0438 \u0441\u0434\u0435\u043b\u0430\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043d\u0430 \u0421\u0438.<br \/>  \u0418\u0433\u0440\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0438\u0433\u0440\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0432\u0438\u0434\u0435:<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/f50\/106\/5b4\/f501065b411516e808739c301816d594.png\"\/><br \/>  \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442 \u043d\u0430 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0435 \u0446\u0438\u0444\u0440\u044b, \u043f\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043a\u043b\u0435\u0442\u043a\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0446\u0438\u0444\u0440\u0430 5 \u2014 \u044d\u0442\u043e \u0446\u0435\u043d\u0442\u0440, 1 \u2014 \u043b\u0435\u0432\u0430\u044f-\u043d\u0438\u0436\u043d\u044f\u044f \u043a\u043b\u0435\u0442\u043a\u0430.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0430\u0440\u0438\u0430\u043d\u0442 1, \u043d\u0430 \u0421\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">\/*   * File:   main.c  * Author: godAlex  *  * \u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u044b\u043c\u0438 \u0441\u0434\u0432\u0438\u0433\u0430\u043c\u0438 \u0438 \u0441\u0430\u043c\u044b\u0439 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043f\u043e \u043e\u0431\u0449\u0435\u043c\u0443 \u0440\u0430\u0437\u043c\u0435\u0440\u0443.  * \u041d\u0430 \u0421\u0438.  *  * Created on 29 \u042f\u043d\u0432\u0430\u0440\u044c 2014 \u0433., 11:51  *\/  #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt;  #define win_x 1 #define win_0 2 #define win_tie 3 #define win_not 0  unsigned short KEYBOARD_BYTE_OFFSET[] = {0x40,0x80,0x100,0x8,0x10,0x20,0x1,0x2,0x4 }; \/\/{0b001000000,0b010000000,0b100000000,0b000001000,0b000010000,0b000100000,0b000000001,0b000000010,0b000000100 }; unsigned short BOT_POSITION_PRIORITY[] = {  0x10,        0x40,       0x4,        0x100,      0x1,        0x80,       0x2,        0x8,        0x20}; \/\/ center       bounds                                          other \/\/{0b000010000, 0b001000000,0b000000100,0b100000000,0b000000001,0b010000000,0b000000010,0b000001000,0b000100000 };  unsigned short WIN_MATRIX[] = { 0x1C0, 0x38, 0x7,  0x124, 0x92, 0x49,  0x111, 0x54 }; \/\/{ 0b111000000, 0b000111000, 0b000000111,  0b100100100, 0b010010010, 0b001001001,  0b100010001, 0b001010100 }; \/\/ \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0434\u043b\u044f \u043f\u043e\u0431\u0435\u0434\u044b unsigned short MAP_X = 0; unsigned short MAP_0 = 0; unsigned short WIN_MATRIX_NOT_WIN = 0x1FF; \/\/0b111111111; \/\/ \u043d\u0438\u0447\u044c\u044f, \u0434\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u0441 xor unsigned short STRING_ENTER_POS = 0x124;\/\/0b100100100; \/\/ \u041f\u043e\u0437\u0438\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0441\u0442\u0440\u043e\u043a   void specialPrintChar(char *c) {     printf(c); \/\/ TODO ASM } unsigned short specialReadNumber() {     char outC;     scanf(&quot;%c&quot;,&outC); \/\/ TODO ASM     return outC-'0'; }  short testWon() {     char i;     for (i=0; i&lt;8; i++) {         if ( (MAP_X & WIN_MATRIX[i]) == WIN_MATRIX[i] ) return win_x;         if ( (MAP_0 & WIN_MATRIX[i]) == WIN_MATRIX[i] ) return win_0;     }     if ( (MAP_X | MAP_0) == WIN_MATRIX_NOT_WIN ) return win_tie; \/\/ \u041d\u0438\u0447\u044c\u044f     return win_not; } void printField() {     unsigned short bOfs;     for (bOfs=1; bOfs&lt;WIN_MATRIX_NOT_WIN; bOfs=bOfs&lt;&lt;1) { \/\/ shl         if ( MAP_X & bOfs ) specialPrintChar(&quot;X&quot;);         else {             if ( MAP_0 & bOfs ) specialPrintChar(&quot;0&quot;);             else specialPrintChar(&quot;.&quot;);         }         if ( bOfs & STRING_ENTER_POS ) specialPrintChar(&quot;\\n&quot;); \/\/ \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u044b \u0441\u0442\u0440\u043e\u043a     } } \/\/ - - - - - - - - - - - - - - - - int main(int argc, char** argv) {     specialPrintChar(&quot;Test XO game!\\n&quot;);     printField(); \/\/ \u0412\u044b\u0432\u043e\u0434     \/\/ \u0418\u0433\u0440\u043e\u0432\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441...     int whoIsWon=win_not;     while (whoIsWon==win_not)     {         short cKey;         unsigned short full_map;         unsigned short p;         \/\/ \u0412\u0432\u043e\u0434 \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b       do { \tdo {             specialPrintChar(&quot;Enter cell position (1-9):\\n&quot;);             cKey = specialReadNumber();         } while ( cKey&lt;1 || cKey&gt;9 );         p=KEYBOARD_BYTE_OFFSET[cKey-1]; \/\/ \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0432 \u043f\u043e\u043b\u0435         full_map = MAP_X | MAP_0; \/\/ \u0432\u0441\u0435 \u043f\u043e\u043b\u044f       } while ( (full_map & p) !=0); \/\/ \u0438\u043b\u0438 \u043f\u043e\u043b\u0435 \u0443\u0436\u0435 \u0437\u0430\u043d\u044f\u0442\u043e.         MAP_X = MAP_X | p; \/\/ \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0440\u0435\u0441\u0442\u0438\u043a  \tprintField(); \/\/ \u0412\u044b\u0432\u043e\u0434 \t\/\/ test Win         whoIsWon=testWon();         if (whoIsWon!=win_not) break;         \t \t\/\/ \u0411\u043e\u0442         full_map = MAP_X | MAP_0;         for (p=0 ; (full_map & BOT_POSITION_PRIORITY[p]) != 0 ; p++);         MAP_0 = MAP_0 | BOT_POSITION_PRIORITY[p]; \/\/ \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u043b\u0438\u043a  \tspecialPrintChar(&quot; the BOT:\\n&quot;); \tprintField(); \/\/ \u0412\u044b\u0432\u043e\u0434 \t \twhoIsWon=testWon(); \/\/ test Win     };     switch (whoIsWon) { \/\/ \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 GoTo label \u0432 testWon (asm) \tcase win_x: \t\tspecialPrintChar(&quot;Won X!\\n&quot;); \t\treturn 1; \tcase win_0: \t\tspecialPrintChar(&quot;Won 0!\\n&quot;); \t\treturn 2;         case win_tie: \t    specialPrintChar(&quot;Win nothing!\\n&quot;); \t    return 3;    }    return (EXIT_SUCCESS); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0414\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0432 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u0443\u0432\u0438\u0434\u0435\u043b, \u0447\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u043e\u0442\u043d\u0438, \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u044f \u0432\u044b\u0437\u043e\u0432\u0430 printf \u0438 scanf. \u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440?  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0430\u0440\u0438\u0430\u043d\u0442 1, \u0444\u0443\u043d\u043a\u0446\u0438\u044f testWon(), \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">int testWon() { \tint winResult=-1; \/\/ todo to asm \t_asm { \t\tmov ecx,0 ;xor ecx,ecx \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u0435\u0435 \t\tmov edx, offset WIN_MATRIX \tlForI: \t\t\/\/mov bx,WIN_MATRIX[ecx] \t\t\tmov bx, word ptr [edx] ; !!! \u043a\u0440\u0438\u0432\u043e \t\t\tadd edx,2 ; [edx][ecx] \t\tmov ax,MAP_X \t\tand ax,bx \t\tcmp ax,bx ; TODO \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0437\u0430\u043c\u0435\u043d\u0443 \u043d\u0430 test, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043a\u0430\u043a \u043d\u0443\u0436\u043d\u043e \u0442\u0443\u0442 \t\tJE lblWonX \t\tmov ax,MAP_0 \t\tand ax,bx \t\tcmp ax,bx \t  JE lblWon0 \t\tinc ecx \t\tcmp ecx,8 \t\tjne lForI \t\tmov ax,MAP_X ; \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u043d\u0438\u0447\u044c\u044e \t\tor ax,MAP_0 \t\tcmp ax,WIN_MATRIX_NOT_WIN \t\tjne lblRet ; \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \t\tmov winResult,win_no ; \u0438\u043b\u0438 \u043d\u0438\u0447\u044c\u044f \t\tjmp lblRet ;RET lblWonX: \t\tmov winResult,win_x \t\tjmp lblRet ;RET lblWon0: \t\tmov winResult,win_0 \t\tjmp lblRet ;RET lblRet: \t\t;RET \t} \treturn winResult; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u043e\u043b\u044c\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0431\u0435\u0434\u044b \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u043a\u043e\u043b\u043e 30 \u043a\u043e\u043c\u0430\u043d\u0434. \u0410 \u0435\u0449\u0451 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0432\u043e\u0434\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d, \u0447\u0442\u0435\u043d\u0438\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b.<br \/>  \u042d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442. \u0417\u0430\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c\u0441\u044f \u0432 \u0411\u041d\u0417, \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e 512 \u0431\u0430\u0439\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u0435\u043a\u0442\u043e\u0440\u0430 \u0434\u0438\u0441\u043a\u0430.<\/p>\n<h4>\u0412\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u2014 \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u043d\u0430 HTML \u0437\u0430 0 \u0441\u0442\u0440\u043e\u043a JS?<\/h4>\n<p>  \u0410 \u0435\u0441\u043b\u0438 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c, \u043a\u0430\u043a \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u043d\u0430 HTML \u0437\u0430 0 \u0441\u0442\u0440\u043e\u043a JavaScript?<br \/>  \u041a\u0430\u0436\u0434\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0433\u0440\u044b \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0432\u044b\u0432\u043e\u0434\u0430 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d, \u0438 \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u0434\u0440\u0435\u0441\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043a\u043d\u043e\u043f\u043e\u043a.<br \/>  \u041d\u0430 HTML \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u043a\u043e\u0440\u043e\u0432 \u0438 \u0434\u043b\u0438\u043d\u043d\u043e\u0439 \u00ab\u043f\u0430\u0440\u0442\u044f\u043d\u043a\u0438\u00bb. \u041d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435, \u0438\u043b\u0438 \u0421\u0438 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0442\u0435\u043a\u0441\u0442 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043d\u043e\u043f\u043e\u043a.<br \/>  \u0421\u0430\u043c\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0439, \u043d\u043e \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u043b\u044f \u0435\u0451 \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0435.<br \/>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u0421\u0438:  <\/p>\n<pre><code class=\"cpp\">#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; unsigned short data_addres[374][9] = {{1, 71, 113, 190, 214, 262, 300, 327, 353}, {1, 1, 2, 16, 24, 31, 45, 52, 65}, ...}; char text[374][13] = {&quot;...\\n...\\n...\\n\\0&quot;, &quot;...\\n...\\nX0.\\n\\0&quot;, &quot;...\\n..0\\nX0X\\n\\0&quot;, ...}; int main(int argc, char** argv) {     unsigned int data_pos = 0;     while (true) \/\/ \u0438\u043b\u0438 data_pos != \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432\u044b\u0445\u043e\u0434\u0430     {         printf(text[data_pos]);         int i;         do scanf(&quot;%i&quot;,&i); while ( i&lt;1 && i&gt;9 );         data_pos=data_addres[data_pos][i-1];     }     return (EXIT_SUCCESS); } <\/code><\/pre>\n<p>  \u0410 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435?  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0430\u0440\u0438\u0430\u043d\u0442 2, \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435 \u0437\u0430 29 \u043a\u043e\u043c\u0430\u043d\u0434, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043d\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f\u0445 BIOS!<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">SECTION .text org 0x100 ; \u0434\u043b\u044f .com \u0444\u0430\u0439\u043b\u043e\u0432. \u042d\u0442\u043e \u043d\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0430, \u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043d\u0430 \u0441\u0434\u0432\u0438\u0433 \u0430\u0434\u0440\u0435\u0441\u043e\u0432. lblShowVariant:    mov ax,0x0001 ; clear screen, set graphic mode 40x25, color   int 10h   mov ax, [data_pos]   mov bx, [TEXT_BLOCK_SIZE]   mul bx   mov bp, text_data   add bp,ax  ; offset \u043d\u0430 \u0442\u0435\u043a\u0441\u0442   mov cx,[TEXT_BLOCK_SIZE]   mov ax,1300h   mov bx,0eh ; color   mov dx,0500h ; 5 \u0441\u0442\u0440\u043e\u043a\u0430 0 \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430   int 10h lReadKey:  rep nop ; \u0430\u0432\u043e\u0441\u044c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u0426\u041f \u0434\u043b\u044f \u0440\u0430\u0437\u043e\u0433\u043d\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u0432. \u0410 \u0442\u0430\u043a \u044d\u0442\u043e \u043b\u0438\u0448\u043d\u044f\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430, \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0440\u0430\u0442\u044c.   xor ax,ax   int 16h ; BIOS read key   xor ah,ah   sub al,'1' ; \u0432 al \u0447\u0438\u0441\u043b\u043e \u0437\u0430\u043f\u0438\u0448\u0435\u043c, \u0430 \u043d\u0435 \u0441\u0438\u043c\u0432\u043e\u043b   cmp ax,8   ja lReadKey   shl ax,1 ; ax=ax*2   mov bx, data_addres   add bx,ax ; bx = data_addres[key]   mov ax, [data_pos]   mov cx, [CASE_BLOCK_SIZE]   mul cx ; cx = [data_pos]   add bx,ax ; bx = data_addres[data_pos][key]   mov ax,[bx]   mov [data_pos],ax ; \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u044e\u0447.   jmp lblShowVariant SECTION .data ; Out data on assembler data format data_pos DW 0 ; max=394 CASE_BLOCK_SIZE DW 18 ;bytes (2 byte per 1 case) TEXT_BLOCK_SIZE DW 16 data_addres: DW 1, 42, 72, 100, 139, 167, 198, 272, 341 DW 1, 2, 7, 9, 13, 14, 1, 17, 33 ... text_data:  DB &quot;...&quot;, 13,10, &quot;...&quot;, 13,10, &quot;...&quot;, 13,10, &quot; &quot; DB &quot;0..&quot;, 13,10, &quot;...&quot;, 13,10, &quot;X..&quot;, 13,10, &quot; &quot; DB &quot;00.&quot;, 13,10, &quot;...&quot;, 13,10, &quot;XX.&quot;, 13,10, &quot; &quot; DB &quot;You are won!&quot;, &quot;    &quot; ... <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0442\u043e\u043b\u044c\u043a\u043e BIOS, \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f \u0431\u0435\u0437 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0434\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0451 \u0432 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0435. \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0443\u043a\u0440\u0430\u0441\u0438\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0438\u0437\u043c\u0435\u043d\u0438\u0432 \u0446\u0432\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u0430. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0431\u0435\u0437 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0437\u0432\u0443\u043a, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0441 \u043a\u043e\u0434\u043e\u043c 7 \u0432 \u0442\u0435\u043a\u0441\u0442 \u043f\u043e\u0431\u0435\u0434\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a (PC speaker).<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/1ee\/681\/44a\/1ee68144a0eae066b2e0863ba8994f4d.png\"\/><br \/>  \u041f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u0434\u0435\u043b\u0430 \u0441\u0434\u0435\u043b\u0430\u043d\u0430. \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u044b\u0441\u044f\u0447 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0438\u0433\u0440\u044b. <br \/>  \u041f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0441\u0447\u0451\u0442\u044b \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445:  <\/p>\n<ul>\n<li>9 \u043a\u043b\u0435\u0442\u043e\u043a (\u043a\u043d\u043e\u043f\u043e\u043a), \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u044f word =&gt; 18 \u0431\u0430\u0439\u0442 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f<\/li>\n<li>13-16 \u0431\u0430\u0439\u0442 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435<\/li>\n<\/ul>\n<p>  \u0418\u0442\u043e\u0433\u043e \u043e\u043a\u043e\u043b\u043e 31-34 \u0431\u0430\u0439\u0442 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u0412\u0441\u0435\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0438\u0433\u0440\u044b \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c 9! (9*8*7*6*5*4*3*2*1 ). \u042d\u0442\u043e \u043c\u043d\u043e\u0433\u043e, \u043d\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0431\u043e\u0440 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0438\u0433\u0440\u043e\u043a\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e \u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 9*7*5*3*1 = 945. \u0415\u0441\u043b\u0438 \u0443\u0447\u0435\u0441\u0442\u044c, \u0447\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u044b \u0434\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043a\u043b\u0435\u0442\u043a\u0438 (\u043f\u043e\u0431\u0435\u0434\u044b, \u043f\u043e\u0440\u0430\u0436\u0435\u043d\u0438\u044f), \u0442\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0435\u0449\u0451 \u043c\u0435\u043d\u044c\u0448\u0435. \u0418\u0442\u043e\u0433\u043e \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0439 \u043d\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0438 \u0430\u0434\u0440\u0435\u0441\u043e\u0432, \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 32130 \u0431\u0430\u0439\u0442 (34*945), \u0447\u0442\u043e \u0443\u043c\u0435\u0441\u0442\u0438\u0442\u0441\u044f \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 (65535 \u0431\u0430\u0439\u0442).<br \/>  \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435, \u0431\u044b\u043b\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430 C++, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0449\u0430\u044f \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0438 \u0432\u044b\u0432\u043e\u0434\u044f\u0449\u0430\u044f \u0438\u0445 \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0434\u043b\u044f C\/C++ \u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430. \u0417\u0430\u0442\u0435\u043c \u0431\u044b\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0432\u043e\u0434\u0430 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430 \u043d\u0430 C, \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435, \u0437\u0430\u0442\u0435\u043c \u0438 HTML \u0441 0 \u0441\u0442\u0440\u043e\u043a JS.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 C++ \u0434\u043b\u044f \u0438\u0433\u0440 \u0432 30 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 assembler, 12 \u0441\u0442\u0440\u043e\u043a \u0421, \u0438 0 \u0441\u0442\u0440\u043e\u043a JS<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">\/*   * Author: godAlex (C) 2014  * License GNU GPL v 3  * param: -h -a -c -sa -sc -sh  *\/ #include &lt;cstdlib&gt; #include &quot;iostream&quot; #include &quot;string.h&quot; using namespace std; \/\/-------------------------------------------  \/\/#define show_debug 1  #define win_x 1 #define win_0 2 #define win_end 3 #define win_gameNext 0  unsigned short KEYBOARD_BYTE_OFFSET[] = {0x40,0x80,0x100,0x8,0x10,0x20,0x1,0x2,0x4 }; \/\/{0b001000000,0b010000000,0b100000000,0b000001000,0b000010000,0b000100000,0b000000001,0b000000010,0b000000100 }; unsigned short BOT_POSITION_PRIORITY[] = {  0x10,        0x40,       0x4,        0x100,      0x1,        0x80,       0x2,        0x8,        0x20}; \/\/ center       bounds                                          other \/\/{0b000010000, 0b001000000,0b000000100,0b100000000,0b000000001,0b010000000,0b000000010,0b000001000,0b000100000 };  #define CASE_BLOCK_SIZE 9 #define TEXT_BLOCK_SIZE 16 int Text_Block_Size=13; \/\/ 13, \u0435\u0441\u043b\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 13, \u0435\u0441\u043b\u0438 13,10 \u0442\u043e 16. \u0418\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0432\u044b\u0432\u043e\u0434\u0435 asm. char End_Of_String=0;  unsigned short WIN_MATRIX[] = { 0x1C0, 0x38, 0x7,  0x124, 0x92, 0x49,  0x111, 0x54 }; \/\/{ 0b111000000, 0b000111000, 0b000000111,  0b100100100, 0b010010010, 0b001001001,  0b100010001, 0b001010100 }; unsigned short MATRIX_FULL = 0x1FF; \/\/0b111111111; unsigned short STRING_ENTER_POS = 0x124;\/\/0b100100100;  int testWon(unsigned short MAP_X,unsigned short MAP_0) {     for (int i=0; i&lt;8; i++) {         if ( (MAP_X & WIN_MATRIX[i]) == WIN_MATRIX[i] ) return win_x;         if ( (MAP_0 & WIN_MATRIX[i]) == WIN_MATRIX[i] ) return win_0;     }     if ( (MAP_X | MAP_0) == MATRIX_FULL ) return win_end;     return win_gameNext; } void printField(unsigned short MAP_X,unsigned short MAP_0, char* result) {     \/\/char result[TEXT_BLOCK_SIZE]=&quot;...\\n...\\n...\\n&quot;;     int p=0;     for (unsigned int bOfs=1; bOfs&lt;MATRIX_FULL; bOfs=bOfs&lt;&lt;1) { \/\/ shl TODO test owerflow!             if ( MAP_X & bOfs ) result[p]='X'; \t\telse {                     if ( MAP_0 & bOfs ) result[p]='0';                     else result[p]='.'; \t\t}             if ( bOfs & STRING_ENTER_POS ) {                 p++;                 result[p]='\\n';             }             p++;     }     result[p]=End_Of_String;     return result; }  #define MAX_DATA_SIZE 30000 unsigned int data_addres[MAX_DATA_SIZE][CASE_BLOCK_SIZE]; \/\/= {{0,0,1,0,1,0,1,0},{0,0,1,0,1,0,1,0}}; char text[MAX_DATA_SIZE][TEXT_BLOCK_SIZE]; \/\/ = { &quot;Hello&quot;,&quot;Hello 2&quot; }; \/\/ \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0434\u043b\u044f \u043f\u043e\u0431\u0435\u0434\u044b unsigned int data_pos = 0;  int setVariant(int varID,unsigned int variants[CASE_BLOCK_SIZE],char* txt) \/\/(unsigned int MAP_X,unsigned int MAP_0) {     int i;     for (i=0;i&lt;CASE_BLOCK_SIZE;i++) data_addres[varID][i]=variants[i]; \/\/ TODO memcopy     for (i=0; i&lt;Text_Block_Size && ( txt[i]!=End_Of_String && txt[i]!=0 ) ; i++) text[varID][i]=txt[i];     text[varID][Text_Block_Size-1]=End_Of_String; \/\/ \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u043d\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0434\u043b\u044f \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430. #ifdef show_debug     cout&lt;&lt;&quot; set \u2116&quot;&lt;&lt;varID&lt;&lt;&quot; as &quot;&lt;&lt;text[varID]&lt;&lt;endl; #endif      return varID; } int getFreeVar() {     int p=data_pos;     data_pos++;     if (p&gt;MAX_DATA_SIZE) {         cout&lt;&lt;&quot;Owerflow data pos!&quot;&lt;&lt;endl;         p=-1;     } #ifdef show_debug     else cout&lt;&lt;&quot;New variant \u2116&quot;&lt;&lt;p&lt;&lt;endl; #endif     return p; }  int itrGameHod_all(unsigned int MAP_X,unsigned int MAP_0, bool playOn_X, int *doRecord);  \/**  * \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u043e\u043c\u0435\u0440 \u044f\u0447\u0435\u0439\u043a\u0438 \u0434\u043b\u044f \u043f\u043e\u0431\u0435\u0434\u044b \u0438\u043b\u0438 \u043d\u0438\u0447\u044c\u0435\u0439 \u0438\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043a\u0430\u043a\u0443\u044e-\u043b\u0438\u0431\u043e.  * \u0418\u0433\u0440\u0430\u0435\u0442 \u0437\u0430 \u043d\u043e\u043b\u0438\u043a (0)  * \u0422\u0438\u043f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 - int [0,8], \u0431\u0435\u0437 \u043f\u043e \u0431\u0438\u0442\u043d\u043e\u0439 \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u0438.  *\/ int getBestBotHod(unsigned int MAP_X,unsigned int MAP_0) { \/\/ TODO \u043d\u0435\u043f\u043e\u0431\u0435\u0434\u0438\u043c\u044b\u0439 bot \u0431\u044b\u043b \u0447\u0442\u043e\u0431\u044b.     unsigned int lastMAP_X=MAP_X;     unsigned int lastMAP_0=MAP_0;     unsigned int full_map = MAP_X | MAP_0;          int winLevel=-1; \/\/ \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0431\u0435\u0434\u044b     int winPos=-1;     \/\/*     for (int i=0; i&lt;9; i++) { \/\/ \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u044c         unsigned short p = 1&lt;&lt;i;         if ( (full_map & p) == 0 ) {             int w=testWon( MAP_X, MAP_0 | p );             if (w==win_0) {                 winLevel=4;                 winPos=p;             }         }     }     \/\/ TODO ...     \/\/if (winLevel&lt;1)      for (int i=0; i&lt;9; i++) { \/\/ \u0432\u0441\u0435 \u043a\u043b\u0435\u0442\u043a\u0438 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f         unsigned short p = 1&lt;&lt;i; \/\/ TODO BOT_POSITION_PRIORITY[i];         if ( (full_map & p) == 0 ) { \/\/ \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u0443\u0441\u0442\u044b\u0445 \u043a\u043b\u0435\u0442\u043e\u043a                 MAP_0 |= p; \/\/ if (playOn_X) MAP_X |= p; else MAP_0 |= p;                 int tmpWLvl=0;                 int w=testWon(MAP_X,MAP_0);                 if ( w!=win_gameNext ) {                     if (w==win_0) tmpWLvl=40;                 } else {                     w=itrGameHod_all(MAP_X,MAP_0, true, 0x00);                     if (w & win_0) tmpWLvl+=4;                     if (w & win_end) tmpWLvl+=2;                     if (w & win_x) tmpWLvl+=0;                 }                 if (tmpWLvl&gt;winLevel) { \/\/|| (tmpWLvl==winLevel && (rand() % 3 == 1))) {                     winLevel=tmpWLvl;                     winPos=i;                 }                 MAP_X=lastMAP_X;                 MAP_0=lastMAP_0;         }     }     return winPos; }  unsigned int winWariantCashe[4]={0,0,0,0}; \/\/ \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0441 \u043f\u043e\u0431\u0435\u0434\u043e\u0439 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c, \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0432 \u043c\u0435\u0441\u0442\u043e. unsigned int winWariantVer[4]={0,0,0,0}; \/\/ \u0421\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u0445\u043e\u0434\u043e\u0432 \u0441 \u043f\u043e\u0431\u0435\u0434\u043e\u0439, \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 unsigned int setEndGameVariant(unsigned int MAP_X,unsigned int MAP_0, char* txt) {     unsigned int currentRecordID;     int wonIs = testWon(MAP_X,MAP_0);     winWariantVer[wonIs]++;     if (winWariantCashe[wonIs]==0) {         unsigned int addres[CASE_BLOCK_SIZE]={0,0,0,0,0,0,0,0,0}; \/\/ \u0430\u0434\u0440\u0435\u0441\u0430 (\u043d\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u043a\u043d\u043e\u043f\u043a\u0443)         currentRecordID=getFreeVar(); \/\/ \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430         setVariant(currentRecordID,addres, txt);         winWariantCashe[wonIs]=currentRecordID;     }     else currentRecordID=winWariantCashe[wonIs];     \/*  \u0431\u044b\u043b\u043e     unsigned int addres[CASE_BLOCK_SIZE]={0,0,0,0,0,0,0,0,0}; \/\/ \u0430\u0434\u0440\u0435\u0441\u0430 (\u043d\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u043a\u043d\u043e\u043f\u043a\u0443)     \/\/currentText= printField (MAP_X,MAP_0); \/\/ \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0431\u0435\u0434\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u0438 \u0442\u0435\u043a\u0441\u0442 \u043e \u043f\u043e\u0431\u0435\u0434\u0435, \u0437\u0430\u043d\u044f\u0432 2 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u0430\u0434\u0440\u0435\u0441\u0430.     int currentRecordID=getFreeVar();     setVariant(currentRecordID,addres, txt);     \/\/*\/     return currentRecordID; }  \/*  * bot \u0438\u0433\u0440\u0430\u0435\u0442 \u0437\u0430 0  * \u043f\u0435\u0440\u0435\u0431\u043e\u0440 \u0432\u0441\u0435\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445  * playOn_X - 0=\u0437\u0430 \u043d\u043e\u043b\u0438\u043a, \u0438\u043d\u0430\u0447\u0435 \u0437\u0430 \u043a\u0440\u0435\u0441\u0442\u0438\u043a  * doRecords - \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e addNewWariant \u0438\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u044b (==0) \u0427\u0442\u043e\u0431\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c - \u043d\u0443\u0436\u0435\u043d \u0430\u0434\u0440\u0435\u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0437\u0430\u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043d\u043e\u043c\u0435\u0440 \u043d\u043e\u0432\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438  *\/ int itrGameHod_all(unsigned int MAP_X,unsigned int MAP_0, bool playOn_X, int *doRecord) {     unsigned int lastMAP_X=MAP_X;     unsigned int lastMAP_0=MAP_0;     unsigned int full_map = MAP_X | MAP_0;     int winResult=0;      if (playOn_X) { \/\/ user, \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b         for (int i=0; i&lt;CASE_BLOCK_SIZE; i++) {             unsigned int p = 1&lt;&lt;i;             if ( (full_map & p) == 0 ) { \/\/ \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u0443\u0441\u0442\u044b\u0445 \u043a\u043b\u0435\u0442\u043e\u043a                 MAP_X |= p; \/\/if (playOn_X) MAP_X |= p; else MAP_0 |= p;                 int w=testWon(MAP_X,MAP_0);                 if (w!=win_gameNext) {                     winResult |= w;                 } else {                     w=itrGameHod_all(MAP_X,MAP_0, !playOn_X, 0x00); \/\/ iteration                 }                 MAP_X=lastMAP_X;                 MAP_0=lastMAP_0;             }         }     } else { \/\/ \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440, \u043b\u0443\u0447\u0448\u0438\u0439 \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442         int i=getBestBotHod(MAP_X,MAP_0);         unsigned short p = 1&lt;&lt;i;         if ( (full_map & p) == 0 ) { \/\/ \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u0443\u0441\u0442\u044b\u0445 \u043a\u043b\u0435\u0442\u043e\u043a             MAP_0 |= p;             int w=testWon(MAP_X,MAP_0);             if (w!=win_gameNext) winResult |= w;             else w=itrGameHod_all(MAP_X,MAP_0, !playOn_X, 0x00); \/\/ iteration             MAP_0=lastMAP_0;         }     }          if (doRecord==0) return winResult; \/\/ \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430     \/\/ TODO \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0438\u043b\u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u0442\u044c          unsigned int addres[CASE_BLOCK_SIZE]; \/\/ \u0430\u0434\u0440\u0435\u0441\u0430 (\u043d\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u043a\u043d\u043e\u043f\u043a\u0443)     char currentText[Text_Block_Size]; \/\/ \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442     printField (MAP_X,MAP_0,currentText);      int currentRecordID=getFreeVar();      if (playOn_X) { \/\/ \u0437\u0430 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430         for (int i=0; i&lt;CASE_BLOCK_SIZE; i++) {             unsigned int p = KEYBOARD_BYTE_OFFSET[i]; \/\/1&lt;&lt;i;             if ( (full_map & p) == 0 ) { \/\/ \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u0443\u0441\u0442\u044b\u0445 \u043a\u043b\u0435\u0442\u043e\u043a                 MAP_X |= p; \/\/if (playOn_X) MAP_X |= p; else MAP_0 |= p;                 int w=testWon(MAP_X,MAP_0);                 if (w!=win_gameNext) {                     \/\/ out wo is won                     if (w==win_x) addres[i]=setEndGameVariant(MAP_X,MAP_0, &quot;You are won!&quot;);                     if (w==win_end) addres[i]=setEndGameVariant(MAP_X,MAP_0, &quot;Not win. End&quot;);                 } else {                     int p2Int=getBestBotHod(MAP_X,MAP_0); \/\/ \u0437\u0430 0, \u0442\u043e \u0435\u0441\u0442\u044c \u0437\u0430 !playOn_X                     \/\/ TODO if p2Int != -1                      short p2Bit=1&lt;&lt;p2Int;                     MAP_0 |= p2Bit;                     int w=testWon(MAP_X,MAP_0);                     if (w!=win_gameNext) {                         \/\/ out wo is won                         if (w==win_0) addres[i]=setEndGameVariant(MAP_X,MAP_0, &quot;Bot won. 0&quot;);                         if (w==win_end)  addres[i]=setEndGameVariant(MAP_X,MAP_0, &quot;Not win. End&quot;);                         \/\/addres[i]=0;\/\/ TODO addres end game                     } else {                         \/\/ add new wariant                         int nextDataAddr;                         w=itrGameHod_all(MAP_X,MAP_0, playOn_X, &nextDataAddr); \/\/ iteration                         addres[i] = nextDataAddr;                     }                 }                 MAP_X=lastMAP_X;                 MAP_0=lastMAP_0;             } else {                 addres[i]=currentRecordID;\/\/ TODO addres current data             }         }         currentRecordID=setVariant(currentRecordID, addres,currentText);         *doRecord=currentRecordID;     } else {         cout&lt;&lt;&quot;Error! \u042d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 \u043d\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d.&quot;&lt;&lt;endl;     }     return winResult; }  void outDataFormatC() {     int minimalCaseSize=1;     if (data_pos&gt;0xff) minimalCaseSize=2;     if (data_pos&gt;0xffff) minimalCaseSize=4;     cout&lt;&lt; &quot;\/\/ Out data on C array:&quot;&lt;&lt;endl;          cout&lt;&lt;&quot;int data_pos = 0; \/\/ max=&quot;&lt;&lt;data_pos&lt;&lt;endl;     cout&lt;&lt;&quot;int CASE_BLOCK_SIZE = &quot;&lt;&lt;CASE_BLOCK_SIZE&lt;&lt;&quot;;&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;int TEXT_BLOCK_SIZE = &quot;&lt;&lt;Text_Block_Size&lt;&lt;&quot;;&quot;&lt;&lt;endl;         cout&lt;&lt;&quot;unsigned &quot;; \/\/data_addres     if (minimalCaseSize==1) cout&lt;&lt;&quot;char&quot;;     if (minimalCaseSize==2) cout&lt;&lt;&quot;short&quot;;     if (minimalCaseSize==4) cout&lt;&lt;&quot;int&quot;;     cout&lt;&lt;&quot; data_addres[&quot;&lt;&lt;data_pos&lt;&lt;&quot;][&quot;&lt;&lt;CASE_BLOCK_SIZE&lt;&lt;&quot;] = {&quot;;     for ( int i=0; i&lt;data_pos; i++) {         if (i!=0) cout&lt;&lt;&quot;, &quot;;         cout&lt;&lt;&quot;{&quot;;         for ( int j=0; j&lt;CASE_BLOCK_SIZE; j++) {             if (j!=0) cout&lt;&lt;&quot;, &quot;;             cout&lt;&lt;data_addres[i][j];         }         cout&lt;&lt;&quot;}&quot;;     }     cout&lt;&lt;&quot;};&quot;&lt;&lt;endl;          \/\/text     cout&lt;&lt;&quot;char text[&quot;&lt;&lt;data_pos&lt;&lt;&quot;][&quot;&lt;&lt;Text_Block_Size&lt;&lt;&quot;] = {&quot;;     for ( int i=0; i&lt;data_pos; i++) {         if (i!=0) cout&lt;&lt;&quot;, &quot;;         \/\/ \u0447\u0438\u0441\u043b\u0430\u043c\u0438         \/\/cout&lt;&lt;&quot;{&quot;;         \/\/for ( int j=0; j&lt;TEXT_BLOCK_SIZE; j++) {         \/\/    if (j!=0) cout&lt;&lt;&quot;, &quot;;         \/\/    cout&lt;&lt; (int)text[i][j];         \/\/}         \/\/cout&lt;&lt;&quot;}&quot;;          \/\/cout&lt;&lt; &quot;\\&quot;&quot;&lt;&lt;text[i]&lt;&lt;&quot;\\&quot;&quot;&lt;&lt;endl; \/\/ \u0432\u044b\u0432\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u0431\u0435\u0437 \u0441\u043f\u0435\u0446 \u0441\u0438\u0432\u043e\u043b\u043e\u0432          cout&lt;&lt;&quot;\\&quot;&quot;;         for ( int j=0; j&lt;Text_Block_Size; j++) {             if (text[i][j]&gt;=30) cout&lt;&lt; text[i][j];             else {                 if (text[i][j]=='\\n') cout&lt;&lt;&quot;\\\\n&quot;;                  else if (text[i][j]==0) cout&lt;&lt;&quot;\\\\0&quot;;                   else cout&lt;&lt; &quot;\\\\(&quot;&lt;&lt;(int)text[i][j]&lt;&lt;&quot;)&quot;;             }         }         cout&lt;&lt;&quot;\\&quot;&quot;;     }     cout&lt;&lt;endl;     cout&lt;&lt;&quot;\/\/ ---- end of data ----&quot;&lt;&lt;endl;  }  void outDataFormatAsm() {     int minimalCaseSize=1;     if (data_pos&gt;0xff) minimalCaseSize=2;     if (data_pos&gt;0xffff) minimalCaseSize=4;      cout&lt;&lt;&quot;; Out data on assembler data format&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;data_pos DW 0 ; max=&quot;&lt;&lt;data_pos&lt;&lt;endl;     cout&lt;&lt;&quot;CASE_BLOCK_SIZE DW &quot;&lt;&lt;CASE_BLOCK_SIZE*minimalCaseSize&lt;&lt;&quot; ;bytes (&quot;&lt;&lt;minimalCaseSize&lt;&lt;&quot; byte per 1 case)&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;TEXT_BLOCK_SIZE DW &quot;&lt;&lt;Text_Block_Size&lt;&lt;endl;     cout&lt;&lt;&quot;data_addres:&quot;&lt;&lt;endl; \/\/data_addres     for ( int i=0; i&lt;data_pos; i++) {         if (minimalCaseSize==1) cout&lt;&lt;&quot;DB &quot;;         if (minimalCaseSize==2) cout&lt;&lt;&quot;DW &quot;;         if (minimalCaseSize==4) cout&lt;&lt;&quot;QW &quot;; \/\/ data_pos wrote as DW, see up         for ( int j=0; j&lt;CASE_BLOCK_SIZE; j++) {             if (j!=0) cout&lt;&lt;&quot;, &quot;;             cout&lt;&lt;data_addres[i][j];         }         cout&lt;&lt;endl;     }     cout&lt;&lt;endl;     \/\/text     cout&lt;&lt;&quot;text_data: \\n&quot;;     bool textMarker=false;     for ( int i=0; i&lt;data_pos; i++) {         cout&lt;&lt;&quot;DB &quot;;         int maxOutBytes=Text_Block_Size;         for ( int j=0; j&lt;maxOutBytes; j++) {             if (text[i][j]&gt;=30) {                 if (!textMarker) {                     if (j!=0) cout&lt;&lt;&quot;, &quot;;                     cout&lt;&lt;&quot;\\&quot;&quot;;                     textMarker=true;                 }                 cout&lt;&lt; text[i][j];             }             else {                 if (textMarker) {                     cout&lt;&lt;&quot;\\&quot;&quot;;                     textMarker=false;                 }                 if (text[i][j]=='\\n') {                     cout&lt;&lt;&quot;, 13,10&quot;;                     maxOutBytes--;                 }                 \/*                 else if (text[i][j]==0) cout&lt;&lt;&quot;, \\&quot;&quot;&lt;&lt;End_Of_String&lt;&lt;&quot;\\&quot;&quot;; \/\/ FIXME \u043e\u0442\u043a\u0443\u0434\u0430 \u043d\u0443\u043b\u0438?                   else \/\/ TODO \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434 DOS int 21h.                  *\/                 else if (text[i][j]==0) cout&lt;&lt;&quot;, \\&quot; \\&quot;&quot;; \/\/ FIXME \u043e\u0442\u043a\u0443\u0434\u0430 \u043d\u0443\u043b\u0438?                   else \/\/ TODO \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434 DOS int 21h.                 cout&lt;&lt; &quot;, &quot;&lt;&lt;(int)text[i][j];             }         }         if (textMarker) {             cout&lt;&lt;&quot;\\&quot;&quot;;             textMarker=false;         }         cout&lt;&lt;endl;     }     cout&lt;&lt;&quot;; ---- end of data ----&quot;&lt;&lt;endl;     return; }  \/**  *   * @param showInfo \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u0434\u0430\u043d\u043d\u044b\u0445  *\/ void generator_game_data(bool showInfo) {     if (showInfo) cout&lt;&lt;&quot;Start generation.&quot;&lt;&lt;endl;     for ( int i=0; i&lt;data_pos; i++) for ( int j=0; j&lt;Text_Block_Size; j++) text[i][j]=End_Of_String;     int startP;     itrGameHod_all(0,0, true, &startP);     if (showInfo) {         cout&lt;&lt; &quot;Finish generation. Start game position=&quot;&lt;&lt;startP&lt;&lt;endl;         cout&lt;&lt; &quot;Data length = &quot;&lt;&lt;data_pos&lt;&lt;endl;         int minimalCaseSize=1;         if (data_pos&gt;0xff) minimalCaseSize=2;         if (data_pos&gt;0xffff) minimalCaseSize=4;         cout&lt;&lt; &quot; key array size is &quot;&lt;&lt;(data_pos*CASE_BLOCK_SIZE*minimalCaseSize)&lt;&lt;&quot; byte (&quot;&lt;&lt;minimalCaseSize&lt;&lt;&quot; byte per case)&quot;&lt;&lt;endl;         cout&lt;&lt; &quot; text array size is &quot;&lt;&lt;(data_pos*Text_Block_Size*sizeof(char))&lt;&lt;&quot; byte&quot;&lt;&lt;endl;         cout&lt;&lt; &quot; \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043e\u0432: \u043d\u0438\u0447\u044c\u044f &quot;&lt;&lt;winWariantVer[win_end]&lt;&lt;&quot;, \u043f\u043e\u0431\u0435\u0434 0 &quot;&lt;&lt;winWariantVer[win_0]&lt;&lt;&quot;, X &quot;&lt;&lt;winWariantVer[win_x]  &lt;&lt;endl;     } } \/\/------------------------------------------- void outListingC() {     cout&lt;&lt;&quot;\/*&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;* example short command tic-tac-toe. By godAlex generator.&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;*\/&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;#include &lt;stdio.h&gt;&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;#include &lt;stdlib.h&gt;&quot;&lt;&lt;endl;     outDataFormatC();     cout&lt;&lt;&quot;int main(int argc, char** argv) {&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;    while (true) {&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;        printf(text[data_pos]);&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;        int i;&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;        do scanf(\\&quot;%i\\&quot;,&i); while ( i&lt;1 && i&gt;9 );&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;        data_pos=data_addres[data_pos][i-1];&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;    }&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;    return (EXIT_SUCCESS);&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;}&quot;&lt;&lt;endl; } void outListingAsm() {     cout&lt;&lt;&quot;SECTION .text&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;org 0x100 ; .com \u0444\u0430\u0439\u043b&quot;&lt;&lt;endl; \/\/    cout&lt;&lt;&quot;push cs&quot;&lt;&lt;endl; \/\/    cout&lt;&lt;&quot;pop ds ; \u0431\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u0442\u043e\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;lblShowVariant: &quot;; \/\/&lt;&lt;endl;     cout&lt;&lt;&quot;  mov ax,0x0001 ; clear screen, set graphic mode 40x25, color&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  int 10h&quot;&lt;&lt;endl; \/* \t; DOS ;\tmov ax, [data_pos] ;\tmov bx, [TEXT_BLOCK_SIZE] ;\tmul bx ;\tmov dx, text_data ;\tadd dx,ax ; offset \u043d\u0430 \u0442\u0435\u043a\u0441\u0442 ;\tmov ah, 0x9 ; print [dx] ;\tint 0x21 ; dos, dx-\u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0443, \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0443\u044e\u0441\u044f $ *\/ \/\/; BIOS     cout&lt;&lt;&quot;  mov ax, [data_pos]&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  mov bx, [TEXT_BLOCK_SIZE]&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  mul bx&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  mov bp, text_data&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  add bp,ax  ; offset \u043d\u0430 \u0442\u0435\u043a\u0441\u0442&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  mov cx,[TEXT_BLOCK_SIZE]&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  mov ax,1300h&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  mov bx,0eh ; color&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  mov dx,0500h ; 5 \u0441\u0442\u0440\u043e\u043a\u0430 0 \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  int 10h&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;lReadKey: &quot;; \/\/&lt;&lt;endl;     cout&lt;&lt;&quot;  rep nop ; \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0440\u0430\u0442\u044c, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432 \u043d\u0430\u0434\u0435\u0436\u0434\u0435 \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u0426\u041f&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  xor ax,ax&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  int 16h ; BIOS read key&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  xor ah,ah&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  sub al,'1' ; \u0432 al \u0447\u0438\u0441\u043b\u043e \u0437\u0430\u043f\u0438\u0448\u0435\u043c, \u0430 \u043d\u0435 \u0441\u0438\u043c\u0432\u043e\u043b&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  cmp ax,8&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  ja lReadKey&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  shl ax,1 ; ax=ax*2&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  mov bx, data_addres&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  add bx,ax ; bx = data_addres[key]&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  mov ax, [data_pos]&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  mov cx, [CASE_BLOCK_SIZE]&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  mul cx ; cx = [data_pos]&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  add bx,ax ; bx = data_addres[data_pos][key]&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  mov ax,[bx]&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  mov [data_pos],ax ; \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u044e\u0447.&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  jmp lblShowVariant&quot;&lt;&lt;endl; \/*\t \t;mov ax, 0x4c00; DOS EXIT, \u043d\u043e \u0443 \u043d\u0430\u0441 \u0438\u0433\u0440\u0430 \u043d\u0435 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0441\u044f )) \t;int 0x21 *\/ \t     cout&lt;&lt;&quot;SECTION .data&quot;&lt;&lt;endl;          \/\/ TODO \u0435\u0441\u043b\u0438 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0434 07 \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e \u043f\u043e\u0431\u0435\u0434\u0435 - \u0431\u0443\u0434\u0435\u0442 \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0439 \u0441\u0438\u0433\u043d\u0430\u043b (PC speaker))     outDataFormatAsm(); } void outListingHTML() {     cout&lt;&lt;&quot;&lt;html&gt;&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;&lt;head&gt;&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;&lt;!-- 0 \u0441\u0442\u0440\u043e\u043a JS --&gt;&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;&lt;script type=\\&quot;text-javascript\\&quot;&gt;&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;&lt;\/script&gt;&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;&lt;style&gt;&quot;&lt;&lt;endl;     cout&lt;&lt;&quot; div {&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;  height: 100%&quot;&lt;&lt;endl;     cout&lt;&lt;&quot; }&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;&lt;\/style&gt;&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;&lt;\/head&gt;&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;&lt;body&gt;&quot;&lt;&lt;endl;     for ( int i=0; i&lt;data_pos; i++) {         cout&lt;&lt;&quot;&lt;div id=\\&quot;p&quot;&lt;&lt;i&lt;&lt;&quot;\\&quot;&gt;&quot;&lt;&lt;endl;         if (text[i][0]=='X' || text[i][0]=='0' || text[i][0]=='.') {             cout&lt;&lt;&quot;&lt;table border=\\&quot;border\\&quot;&gt;&quot;&lt;&lt;endl;             cout&lt;&lt;&quot;&lt;tr&gt;&quot;&lt;&lt;endl;             cout&lt;&lt;&quot;  &lt;td&gt;&lt;a href=\\&quot;#p&quot;&lt;&lt;data_addres[i][0]&lt;&lt;&quot;\\&quot;&gt;&quot;&lt;&lt;text[i][6+2]&lt;&lt;&quot;&lt;\/a&gt;&lt;\/td&gt;&quot;&lt;&lt;endl;             cout&lt;&lt;&quot;  &lt;td&gt;&lt;a href=\\&quot;#p&quot;&lt;&lt;data_addres[i][1]&lt;&lt;&quot;\\&quot;&gt;&quot;&lt;&lt;text[i][7+2]&lt;&lt;&quot;&lt;\/a&gt;&lt;\/td&gt;&quot;&lt;&lt;endl;             cout&lt;&lt;&quot;  &lt;td&gt;&lt;a href=\\&quot;#p&quot;&lt;&lt;data_addres[i][2]&lt;&lt;&quot;\\&quot;&gt;&quot;&lt;&lt;text[i][8+2]&lt;&lt;&quot;&lt;\/a&gt;&lt;\/td&gt;&quot;&lt;&lt;endl;             cout&lt;&lt;&quot;&lt;\/tr&gt;&lt;tr&gt;&quot;&lt;&lt;endl;             cout&lt;&lt;&quot;  &lt;td&gt;&lt;a href=\\&quot;#p&quot;&lt;&lt;data_addres[i][3]&lt;&lt;&quot;\\&quot;&gt;&quot;&lt;&lt;text[i][3+1]&lt;&lt;&quot;&lt;\/a&gt;&lt;\/td&gt;&quot;&lt;&lt;endl;             cout&lt;&lt;&quot;  &lt;td&gt;&lt;a href=\\&quot;#p&quot;&lt;&lt;data_addres[i][4]&lt;&lt;&quot;\\&quot;&gt;&quot;&lt;&lt;text[i][4+1]&lt;&lt;&quot;&lt;\/a&gt;&lt;\/td&gt;&quot;&lt;&lt;endl;             cout&lt;&lt;&quot;  &lt;td&gt;&lt;a href=\\&quot;#p&quot;&lt;&lt;data_addres[i][5]&lt;&lt;&quot;\\&quot;&gt;&quot;&lt;&lt;text[i][5+1]&lt;&lt;&quot;&lt;\/a&gt;&lt;\/td&gt;&quot;&lt;&lt;endl;             cout&lt;&lt;&quot;&lt;\/tr&gt;&lt;tr&gt;&quot;&lt;&lt;endl;             cout&lt;&lt;&quot;  &lt;td&gt;&lt;a href=\\&quot;#p&quot;&lt;&lt;data_addres[i][6]&lt;&lt;&quot;\\&quot;&gt;&quot;&lt;&lt;text[i][0]&lt;&lt;&quot;&lt;\/a&gt;&lt;\/td&gt;&quot;&lt;&lt;endl;             cout&lt;&lt;&quot;  &lt;td&gt;&lt;a href=\\&quot;#p&quot;&lt;&lt;data_addres[i][7]&lt;&lt;&quot;\\&quot;&gt;&quot;&lt;&lt;text[i][1]&lt;&lt;&quot;&lt;\/a&gt;&lt;\/td&gt;&quot;&lt;&lt;endl;             cout&lt;&lt;&quot;  &lt;td&gt;&lt;a href=\\&quot;#p&quot;&lt;&lt;data_addres[i][8]&lt;&lt;&quot;\\&quot;&gt;&quot;&lt;&lt;text[i][2]&lt;&lt;&quot;&lt;\/a&gt;&lt;\/td&gt;&quot;&lt;&lt;endl;             cout&lt;&lt;&quot;&lt;\/tr&gt;&quot;&lt;&lt;endl;             cout&lt;&lt;&quot;&lt;\/table&gt;&quot;&lt;&lt;endl;         }         else cout&lt;&lt;&quot;&lt;a href=\\&quot;#p&quot;&lt;&lt;data_addres[i][0]&lt;&lt;&quot;\\&quot;&gt;&quot;&lt;&lt;text[i]&lt;&lt;&quot;&lt;\/a&gt;&quot;&lt;&lt;endl;         cout&lt;&lt;&quot;&lt;\/div&gt;&quot;&lt;&lt;endl;     }     cout&lt;&lt;&quot;&lt;\/body&gt;&quot;&lt;&lt;endl;     cout&lt;&lt;&quot;&lt;\/html&gt;&quot;&lt;&lt;endl; }  int main(int argc, char** argv) {     int outFormat=-1; \/\/ 0 - assembler data, 1 - C array     if (argc==2) {         if ( strcmp(argv[1],&quot;--help&quot;)==0 ) {             cout&lt;&lt;&quot;\u041d\u0435\u0432\u0435\u0440\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 --help \u0434\u043b\u044f \u0441\u043f\u0440\u0430\u0432\u043a\u0438.&quot;&lt;&lt;endl;             cout&lt;&lt;&quot; --help \u0432\u044b\u0432\u043e\u0434 \u044d\u0442\u043e\u0439 \u0441\u043f\u0440\u0430\u0432\u043a\u0438.&quot;&lt;&lt;endl;             cout&lt;&lt;&quot; -a \u0432\u044b\u0432\u043e\u0434 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0434\u043b\u044f \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e)&quot;&lt;&lt;endl;             cout&lt;&lt;&quot; -\u0441 \u0432\u044b\u0432\u043e\u0434 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0421 \u043c\u0430\u0441\u0441\u0438\u0432\u0430&quot;&lt;&lt;endl;             cout&lt;&lt;&quot; -sa \u0432\u044b\u0432\u043e\u0434 \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435&quot;&lt;&lt;endl;             cout&lt;&lt;&quot; -s\u0441 \u0432\u044b\u0432\u043e\u0434 \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 C&quot;&lt;&lt;endl;             cout&lt;&lt;&quot; -sh \u0432\u044b\u0432\u043e\u0434 \u0432 HTML&quot;&lt;&lt;endl;             return 0;         }         if ( strcmp(argv[1],&quot;-a&quot;)==0 ) outFormat=0;         if ( strcmp(argv[1],&quot;-c&quot;)==0 ) outFormat=1;         if ( strcmp(argv[1],&quot;-sa&quot;)==0 ) outFormat=2;         if ( strcmp(argv[1],&quot;-sc&quot;)==0 ) outFormat=3;         if ( strcmp(argv[1],&quot;-sh&quot;)==0 ) outFormat=4;     } else outFormat=0; \/\/ \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. default - assembler out (0-asm, 1-C array))     if ( argc&gt;2 || outFormat==-1 ) {         cout&lt;&lt;&quot;\u041d\u0435\u0432\u0435\u0440\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 --help \u0434\u043b\u044f \u0441\u043f\u0440\u0430\u0432\u043a\u0438.&quot;&lt;&lt;endl;         return 1;     }          if ( outFormat==0 || outFormat==2 ) {         \/\/End_Of_String = '$'; \/\/ \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u043d\u0446\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043b\u044f DOS         Text_Block_Size=13+3;     }     generator_game_data( outFormat&lt;2);          if (outFormat==0) outDataFormatAsm();     if (outFormat==1) outDataFormatC();          if (outFormat==2) outListingAsm();     if (outFormat==3) outListingC();     if (outFormat==4) outListingHTML();         return 0; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0435, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0435 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c &quot;&#8212;help&quot; \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0441\u043f\u0440\u0430\u0432\u043a\u0438, \u0438\u043b\u0438 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438:  <\/p>\n<ul>\n<li>\u0410\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440: \u00abgenerator.exe -sa &gt; name.asm\u00bb, \u0437\u0430\u0442\u0435\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0435. \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c nasm, \u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u00abnasm -f bin name.asm -o asm30TTG.com\u00bb, \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0435 \u00abasm30TTG.com\u00bb \u0438 \u0438\u0433\u0440\u0430\u0435\u0442\u0435. \u0412\u044b\u0445\u043e\u0434 \u0438\u0437 \u0438\u0433\u0440\u044b \u043d\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d, \u043c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u043b\u043e.  <\/li>\n<li>\u0421\u0438: \u00abgenerator.exe -sc &gt; name.c\u00bb \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a.<\/li>\n<li>HTML: \u00abgenerator.exe -sh &gt; name.html\u00bb<\/li>\n<\/ul>\n<h5>\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h5>\n<p>  \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0433\u0440\u0443 \u0437\u0430 30 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 Java Script, \u043d\u043e \u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0438 \u043d\u0430 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0438 \u043d\u0430 \u0440\u0430\u0437\u043c\u0435\u0440. \u041d\u043e \u0432\u044b\u0431\u043e\u0440 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u0438\u043b\u0438 \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/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=\"http:\/\/habrahabr.ru\/post\/207964\/\"> http:\/\/habrahabr.ru\/post\/207964\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0433\u043e\u0434\u0443 \u0431\u044b\u043b\u0438 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b \u0442\u0435\u043c\u044b, \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0437\u0430 30 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430. \u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0431\u044b\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u043d\u044b \u043d\u0430 JavaScript. \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0431 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430, \u043d\u043e \u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u0440\u0430\u0437\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u044f\u0434\u0440\u043e \u041e\u0421 \u043d\u0430\u043a\u043e\u043d\u0435\u0446. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043d\u0435 30 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430, \u0430 \u0434\u0435\u0441\u044f\u0442\u043a\u0438, \u0441\u043e\u0442\u043d\u0438 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0435\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430.<br \/>  \u0410 \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0437\u0430 30 \u0441\u0442\u0440\u043e\u043a \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430, \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442 \u041e\u0421?<br \/>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043e\u043f\u0438\u0448\u0443, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0440\u0435\u0441\u0442\u0438\u043a\u0438-\u043d\u043e\u043b\u0438\u043a\u0438 \u0437\u0430 30 \u0441\u0442\u0440\u043e\u043a \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430.  <\/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-207964","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/207964","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=207964"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/207964\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=207964"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=207964"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=207964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}