{"id":350375,"date":"2023-07-17T21:01:20","date_gmt":"2023-07-17T21:01:20","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=350375"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=350375","title":{"rendered":"<span>\u041a\u0440\u0435\u0441\u0442\u0438\u043a\u0438-\u041d\u043e\u043b\u0438\u043a\u0438 (Tic Tac Toe) \u0441 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c \u043d\u0430 Python. \u041c\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 \u043a Machine Learning. \u0427\u0430\u0441\u0442\u044c 1<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442. \u042f \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044c Python \u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0434\u043e\u043b\u0433\u043e \u043e\u0441\u0432\u0430\u0438\u0432\u0430\u044e \u044f\u0437\u044b\u043a \u0432\u0441\u0435\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. \u041c\u043e\u044f \u0446\u0435\u043b\u044c &#8212; \u043f\u043e\u043d\u044f\u0442\u044c \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u0435\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u044c \u0441 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c\u044e. \u041d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u0430 \u0432 IT \u043d\u0435 \u0438\u043c\u0435\u043b, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0438\u0437\u043b\u0430\u0433\u0430\u0442\u044c \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u043e\u0439 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043b\u043e\u0433\u0438\u0435\u0439, \u043d\u0435 \u0441\u0443\u0434\u0438\u0442\u0435 \u0441\u0442\u0440\u043e\u0433\u043e. \u041c\u043e\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u0430\u044f, \u0434\u0430\u043b\u0435\u043a\u0430 \u043e\u0442 IT, \u043d\u043e \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u043d\u0435\u0435 \u0432\u0441\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u043d\u0435\u0434\u0440\u044f\u044e\u0442\u0441\u044f AI \u0438 ML. \u041c\u043d\u043e\u044e \u0434\u0432\u0438\u0436\u0435\u0442 \u043b\u0438\u0448\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u043a \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f\u043c, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e.<\/p>\n<p>\u0412 <strong>\u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/strong> \u043f\u043e\u043a\u0430\u0436\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u044d\u0442\u0430\u043f\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u0433\u0440\u044b, \u0433\u0434\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0440\u043e\u043b\u044c (\u0425 \u0438\u043b\u0438 \u041e), \u0438\u0433\u0440\u0430\u044f \u0441 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c. \u041f\u043e\u0438\u0441\u043a \u0432 \u0441\u0435\u0442\u0438 Python \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432 \u0434\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0438\u0433\u0440\u044b \u0441 \u0440\u0430\u043d\u0434\u043e\u043c\u043d\u044b\u043c \u043e\u0442\u0432\u0435\u0442\u043e\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430. \u041c\u043e\u0439 \u0446\u0435\u043b\u044c\u044e \u0432 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u043b\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u043d\u0430 \u043f\u043e\u043b\u0435 &#171;\u041a\u0440\u0435\u0441\u0442\u0438\u043a\u0438-\u041d\u043e\u043b\u0438\u043a\u0438&#187; \u0438 \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0445\u043e\u0434\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430. \u041a \u0441\u043b\u043e\u0432\u0443, \u0443\u0436\u0435 \u043f\u0435\u0440\u0435\u0434 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435\u043c \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0430\u0448\u0435\u043b \u0433\u043e\u0442\u043e\u0432\u0443\u044e web-\u0438\u0433\u0440\u0443 \u0432 google, \u0433\u0434\u0435 \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434. \u0422\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0435\u0431\u044f \u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f &#171;\u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043b\u0435\u0441\u0430, \u043d\u043e \u043f\u043e-\u0441\u0432\u043e\u0435\u043c\u0443&#187;. <\/p>\n<p>\u0412\u043e <strong>\u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/strong> \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u043a \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0435 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 &#8212; \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0441\u044b\u0433\u0440\u0430\u043d\u043d\u044b\u0445 \u043f\u0430\u0440\u0442\u0438\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c \u0441 \u0441\u0430\u043c\u0438\u043c \u0441\u043e\u0431\u043e\u0439.<\/p>\n<p><strong>\u041a\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b:<\/strong> \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044f\u043c Python, \u043b\u043e\u0433\u0438\u043a\u0438, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432. \u0412 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u0440\u043e\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c.<\/p>\n<p><strong>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438:<\/strong><\/p>\n<ol>\n<li>\n<p>\u0417\u0430\u0447\u0435\u043c \u041a\u0440\u0435\u0441\u0442\u0438\u043a\u0430\u043c\u2011\u041d\u043e\u043b\u0438\u043a\u0430\u043c \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435?<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044f 3\u04453 \u0432 \u0432\u0438\u0434\u0435 \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0440\u043e\u0442\u043a\u043e \u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445.<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u0440\u0442\u0430 \u043b\u0443\u0447\u0448\u0438\u0445 \u0445\u043e\u0434\u043e\u0432 \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0418\u0433\u0440\u043e\u043a\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430?<\/p>\n<\/li>\n<li>\n<p>\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<\/li>\n<li>\n<p>\u0410\u043d\u043e\u043d\u0441 \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438<\/p>\n<\/li>\n<\/ol>\n<h3>\u0417\u0430\u0447\u0435\u043c \u041a\u0440\u0435\u0441\u0442\u0438\u043a\u0430\u043c\u2011\u041d\u043e\u043b\u0438\u043a\u0430\u043c \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435?<\/h3>\n<p>\u041e\u0442\u0432\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439: \u0448\u0430\u0445\u043c\u0430\u0442\u044b \u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0418\u0418. \u042d\u0442\u0438 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432 \u0436\u0438\u0437\u043d\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0443\u0442\u0438 &#8212; \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0438\u0433\u0440\u0430. \u041a\u0430\u043a \u043c\u043d\u0435 \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0432\u0441\u0435 \u0445\u043e\u0434\u044b \u043a\u0430\u043a \u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b \u043f\u0440\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u0434\u0432\u0438\u0436\u043e\u043a \u043d\u0430 CHESS.com \u043f\u043e\u0440\u0430\u0436\u0430\u0435\u0442, \u043a\u0430\u043a \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 DEEP-L. \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0432\u0441\u0435 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0448\u0430\u0445\u043c\u0430\u0442\u043d\u044b\u0435 \u043f\u0430\u0440\u0442\u0438\u0438 \u0441 XIX \u0432\u0435\u043a\u0430 \u0432\u043d\u0435\u0441\u043b\u0438 \u0432 \u0431\u0430\u0437\u0443 \u0418\u0418 (\u0431\u043b\u0430\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u0438\u0445 \u0432 \u0432\u0438\u0434\u0435 \u0448\u0430\u0445\u043c\u0430\u0442\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0443\u043b). \u0417\u0430\u0442\u0435\u043c \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u043c\u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u043f\u043e\u0438\u0441\u043a \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u043e\u0434\u0430. \u0412\u044b\u044f\u0441\u043d\u0438\u043b\u0438, \u0447\u0442\u043e \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0430\u0442\u044c, \u0432\u0435\u0434\u044c \u0448\u0430\u0445\u043c\u0430\u0442\u0438\u0441\u0442\u044b \u0440\u0430\u0441\u0442\u0443\u0442 \u0434\u0430 \u0438 \u0438\u0433\u0440\u0430\u0435\u0442 \u0443\u0436\u0435 \u0432\u0435\u0441\u044c \u043c\u0438\u0440. \u0410 \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0430\u0440\u0442\u0438\u0439, \u0442\u0435\u043c \u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u0435\u0435 \u0438\u0445 \u0430\u043d\u0430\u043b\u0438\u0437 (\u0445\u043e\u0442\u044c \u0438 \u0434\u043e\u043b\u044c\u0448\u0435). \u041f\u0440\u0438\u0434\u0443\u043c\u0430\u043b\u0438 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e \u043f\u043e\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0448\u0430\u0445\u043c\u0430\u0442\u043d\u0443\u044e \u0431\u0430\u0437\u0443 \u0432 \u0418\u0418, \u0441\u043d\u043e\u0432\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043b\u0443\u0447\u0448\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0445\u043e\u0434\u0430, \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044f \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0438 \u043f\u043e\u0438\u0441\u043a\u0430. \u0422\u0430\u043a \u044f \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0443\u044e \u0438\u0433\u0440\u0443, \u0433\u0434\u0435 \u043c\u0430\u0448\u0438\u043d\u0443 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u0434\u043e \u0438\u0434\u0435\u0430\u043b\u0430 \u043f\u043e \u044d\u0442\u043e\u0439 \u0441\u0445\u0435\u043c\u0435. \u0412\u044b\u0431\u043e\u0440 \u043f\u0430\u043b Tic Tac Toe \u0441 \u043f\u043e\u043b\u0435\u043c 3\u04453. \u041d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0435\u0449\u0435 \u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441 \u043d\u0443\u043b\u044f. \u041e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043b \u0441\u0435\u0431\u0435 \u044d\u0442\u0430\u043f\u044b Machine Learning (\u0442\u0435\u043c\u0430 <strong>\u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/strong>): <\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0418\u0418 \u0443\u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0438\u0433\u0440, <\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0438 \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u043e\u0442\u0431\u043e\u0440\u0430 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u043e\u0434\u0430.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044f 3\u04453 \u0432 \u0432\u0438\u0434\u0435 \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430<\/h3>\n<p>\u042f \u0440\u0435\u0448\u0438\u043b \u0443\u0439\u0442\u0438 \u043e\u0442 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 list, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044f. \u0418\u0433\u0440\u043e\u043a\u0430 &#171;\u0425&#187; \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043b \u043a\u0430\u043a &#171;-1&#187;, &#171;\u041e&#187; \u043a\u0430\u043a &#171;1&#187;. \u041d\u0435\u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f &#171;0&#187;. \u042d\u0442\u043e  \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0439 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430\u0448\u0430 \u0438\u0433\u0440\u0430 &#8212; \u044d\u0442\u043e \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441 9\u044e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044f\u0445 \u043e\u0442 0 \u0434\u043e 8, \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u0430\u0447\u0430\u043b\u043e: <strong>TTT=[0, 0, 0, 0, 0, 0, 0, 0, 0]<\/strong>  (\u0440\u0438\u0441. 1 \u0438 2):<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/4ae\/08c\/c1a\/4ae08cc1a48796018cbddecab4c64f0e.jpg\" alt=\"\u0420\u0438\u0441. 1. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0440\u0430\u0432\u043d\u0430 \u043a\u043b\u0435\u0442\u043a\u0435 \u043d\u0430 \u043f\u043e\u043b\u0435 3\u04453. \u041d\u0430\u0447\u0430\u043b\u043e \u0438\u0433\u0440\u044b: TTT=[0, 0, 0, 0, 0, 0, 0, 0, 0]\" title=\"\u0420\u0438\u0441. 1. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0440\u0430\u0432\u043d\u0430 \u043a\u043b\u0435\u0442\u043a\u0435 \u043d\u0430 \u043f\u043e\u043b\u0435 3\u04453. \u041d\u0430\u0447\u0430\u043b\u043e \u0438\u0433\u0440\u044b: TTT=[0, 0, 0, 0, 0, 0, 0, 0, 0]\" width=\"379\" height=\"265\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4ae\/08c\/c1a\/4ae08cc1a48796018cbddecab4c64f0e.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441. 1. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0440\u0430\u0432\u043d\u0430 \u043a\u043b\u0435\u0442\u043a\u0435 \u043d\u0430 \u043f\u043e\u043b\u0435 3\u04453. \u041d\u0430\u0447\u0430\u043b\u043e \u0438\u0433\u0440\u044b: TTT=[0, 0, 0, 0, 0, 0, 0, 0, 0]<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/96c\/0eb\/41e\/96c0eb41e50a6624beed4205ec4a5b22.jpg\" alt=\"\u0420\u0438\u0441. 2. \u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043f\u0438\u0441\u043a\u0430, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043f\u043e\u043b\u0435 TTT=[-1, 0, 1, 0, -1, 0, 0, 0, 1].\" title=\"\u0420\u0438\u0441. 2. \u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043f\u0438\u0441\u043a\u0430, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043f\u043e\u043b\u0435 TTT=[-1, 0, 1, 0, -1, 0, 0, 0, 1].\" width=\"416\" height=\"263\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/96c\/0eb\/41e\/96c0eb41e50a6624beed4205ec4a5b22.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441. 2. \u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043f\u0438\u0441\u043a\u0430, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043f\u043e\u043b\u0435 <u>TTT=[-1, 0, 1, 0, -1, 0, 0, 0, 1]<\/u>.<\/figcaption><\/div>\n<\/figure>\n<h3>\u041a\u043e\u0440\u043e\u0442\u043a\u043e \u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445<\/h3>\n<p>\u0418\u0433\u0440\u0430 \u0438\u043c\u0435\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0438\u0433\u0440\u043e\u0432\u044b\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435.<\/p>\n<p><strong>pygame:<\/strong> \u0412\u044b\u0431\u0440\u0430\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043e\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u043f\u043e\u043b\u0447\u0430\u0441\u0430 \u0441 \u0433\u0443\u0433\u043b. <\/p>\n<pre><code class=\"python\">import pygame as pg, sys from pygame.locals import * import time, random  width = 400 height = 400 white = (255, 255, 255) RED = (255, 0, 0) BLACK = (0, 0, 0) line_color = (10, 10, 10)  # initializing pygame window pg.init() fps = 30 CLOCK = pg.time.Clock() screen = pg.display.set_mode((width, height + 100), 0, 32) pg.display.set_caption(\"Tic Tac Toe\")  # loading the images opening = pg.image.load('tic tac opening.png') x_img = pg.image.load('x.png') o_img = pg.image.load('o.png')  # resizing images x_img = pg.transform.scale(x_img, (80, 80)) o_img = pg.transform.scale(o_img, (80, 80)) opening = pg.transform.scale(opening, (width, height + 100))<\/code><\/pre>\n<p><strong>user_click():<\/strong> \u0412\u044b\u0431\u043e\u0440 \u043c\u044b\u0448\u043a\u043e\u0439 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0431\u0435\u0437 \u0438\u0437\u044b\u0441\u043a\u043e\u0432: \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u043a\u0442\u043e\u0440\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0435\u0433\u043e \u043d\u043e\u043c\u0435\u0440 \u043a\u0430\u043a \u043d\u0430 \u0440\u0438\u0441.1., \u0447\u0442\u043e \u0437\u0430\u043b\u043e\u0436\u0435\u043d\u043e \u0432 \u0447\u0438\u0441\u043b\u043e\u0432\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong><u>move<\/u><\/strong>. <\/p>\n<pre><code class=\"python\">def user_click(): # mouse click     global move     move = None     # get coordinates of mouse click     x, y = pg.mouse.get_pos()     # get x,y of mouse click (cell 0-8)     if (y &lt; height \/ 3) and (x &lt; width \/ 3):         move = 0     elif (y &lt; height \/ 3) and (x &lt; width \/ 3 * 2):         move = 1     elif (y &lt; height \/ 3) and (x &lt; width):         move = 2      elif (y &lt; height \/ 3 * 2) and (x &lt; width \/ 3):         move = 3     elif (y &lt; height \/ 3 * 2) and (x &lt; width \/ 3 * 2):         move = 4     elif (y &lt; height \/ 3 * 2) and (x &lt; width):         move = 5      elif (y &lt; height) and (x &lt; width \/ 3):         move = 6     elif (y &lt; height) and (x &lt; width \/ 3 * 2):         move = 7     elif (y &lt; height) and (x &lt; width):         move = 8<\/code><\/pre>\n<p><strong>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435:<\/strong>  <strong>XO <\/strong>&#8212; \u044d\u0442\u043e<strong> <\/strong>\u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0425 (-1) \u0438\u043b\u0438 \u041e (1) \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 <strong>TTT=[  ]<\/strong>.<strong> <\/strong>\u041f\u0435\u0440\u043c\u0435\u043d\u043d\u044b\u0435 <strong>\u0425\u041e<\/strong> \u0438 <strong>move<\/strong> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <strong><em>None<\/em><\/strong>, \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435<u>,<\/u> \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445. \u0413\u043e\u0432\u043e\u0440\u044f\u0449\u0438\u0435 \u0437\u0430 \u0441\u0435\u0431\u044f <strong>winner<\/strong> \u0438 <strong>draw<\/strong> &#8212; \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u044c \u0438 \u043d\u0438\u0447\u044c\u044f.<\/p>\n<pre><code class=\"python\">XO = None  # -1 is X-player, 1 is O-player move = None # numbers from 0 to 8 winner = None draw = False      # TicTacToe 3x3 board TTT= [0,0,0,0,0,0,0,0,0]     # game field is shared on 9 cells with determination of each one from left to right in upper,middle &amp; lower row:     # 0,1,2 - upper row     # 3,4,5 - middle row     # 6,7,8 - lower row     # totaly = 3x3 field = 9 numbers (from 0 to 8 considering that list [TTT] starts with 0 position)<\/code><\/pre>\n<p><strong>\u0441heck_win():<\/strong>  \u041f\u0435\u0440\u0435\u0431\u043e\u0440\u043e\u043c \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0439 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044f \u0422\u0422\u0422 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0440\u0438 -1 \u0438\u043b\u0438 1 \u0432 \u0440\u044f\u0434\u0443 (\u043d\u043e \u0438 \u043d\u0435 \u043d\u043e\u043b\u044c!), \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438 \u0438\u043b\u0438 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0438\u0441\u0443\u0435\u0442 \u043b\u0438\u043d\u0438\u044e \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0431\u0435\u0434\u043d\u0443\u044e \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044e \u0438 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 winner \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 -1 (\u0425) \u0438\u043b\u0438 1 (\u041e).  <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/ebe\/593\/7ed\/ebe5937edb5036fc5c85fca806e7838d.jpg\" alt=\"\u0420\u0438\u0441.3. \u0414\u0432\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0431\u0435\u0434 \u0438 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u0432\u0438\u0434 \u0441\u043f\u0438\u0441\u043a\u0430 \u0422\u0422\u0422 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c.\" title=\"\u0420\u0438\u0441.3. \u0414\u0432\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0431\u0435\u0434 \u0438 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u0432\u0438\u0434 \u0441\u043f\u0438\u0441\u043a\u0430 \u0422\u0422\u0422 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c.\" width=\"401\" height=\"464\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ebe\/593\/7ed\/ebe5937edb5036fc5c85fca806e7838d.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441.3. \u0414\u0432\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0431\u0435\u0434 \u0438 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u0432\u0438\u0434 \u0441\u043f\u0438\u0441\u043a\u0430 \u0422\u0422\u0422 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c.<\/figcaption><\/div>\n<\/figure>\n<pre><code class=\"python\">def check_win(): # check winner and drawing the appropriate lines     global TTT, winner, draw      # check for winning rows     for row in range(0, 7, 3):  # jump through 3 in TTT list         if ((TTT[row] == TTT[row + 1] == TTT[row + 2]) and (TTT[row] != 0)):             # this row won             winner = TTT[row]             pg.draw.line(screen, (250, 0, 0), (0, (row\/3 + 1) * height \/ 3 - height \/ 6), \\                          (width, (row\/3 + 1) * height \/ 3 - height \/ 6), 6)             break      # check for winning columns     for col in range(0, 3, 1):  # jump through 1 in TTT list         if (TTT[col] == TTT[col + 3] == TTT[col + 6]) and (TTT[col] != 0):             # this column won             winner = TTT[col]             # draw winning line             pg.draw.line(screen, (250, 0, 0), ((col + 1) * width \/ 3 - width \/ 6, 0), \\                          ((col + 1) * width \/ 3 - width \/ 6, height), 6)             break      # check for diagonal winners     if (TTT[0] == TTT[4] == TTT[8]) and (TTT[0] != 0):         # game won diagonally left to right         winner = TTT[0]         pg.draw.line(screen, (250, 70, 70), (50, 50), (350, 350), 6)      if (TTT[2] == TTT[4] == TTT[6]) and (TTT[2] != 0):         # game won diagonally right to left         winner = TTT[2]         pg.draw.line(screen, (250, 70, 70), (350, 50), (50, 350), 6)      if TTT.count(0) == 0 and winner is None:  # all cells are filled in         draw = True      game_status()<\/code><\/pre>\n<h3>\u041a\u0430\u0440\u0442\u0430 \u043b\u0443\u0447\u0448\u0438\u0445 \u0445\u043e\u0434\u043e\u0432 \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430<\/h3>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e &#8212; \u044d\u0442\u043e \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435. \u042f \u0440\u0435\u0448\u0438\u043b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0441\u043f\u0438\u0441\u043e\u043a  <strong>mov_map<\/strong>  \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044f. \u0421\u044e\u0434\u0430 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0443\u0436\u043d\u044b\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0445\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u0431\u0435\u0434\u044b. \u041f\u0430\u0440\u0443 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 (\u0420\u0438\u0441.4.), \u043a\u043e\u0433\u0434\u0430 \u043d\u0430 7\u043c \u0445\u043e\u0434\u0443 \u0425 (<strong>\u0425\u041e=-1<\/strong>) \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0443\u0434\u0430, \u0433\u0434\u0435 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0425\u0425 \u0440\u044f\u0434\u043e\u043c \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c (\u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u044c \u041b\u0435\u0432\u043e-\u041f\u0440\u0430\u0432\u043e):<\/p>\n<\/li>\n<\/ol>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/679\/34f\/9fd\/67934f9fdfdd8417df3e4bbf42174acd.jpg\" alt=\"\u0420\u0438\u0441.4. \u0412 \u0436\u0435\u043b\u0442\u0443\u044e \u043a\u043b\u0435\u0442\u043a\u0443 \u043f\u0440\u043e\u0441\u0438\u0442\u0441\u044f \u0425 \u0434\u043b\u044f \u043f\u043e\u0431\u0435\u0434\u044b (\u0441\u043f\u0438\u0441\u043e\u043a \u0422\u0422\u0422[8]). \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 mov_map[8] \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0440\u0430\u0441\u043d\u044b\u0439 -1 (\u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0439 \u0431\u0443\u0434\u0443\u0449\u0438\u0439 \u0445\u043e\u0434 \u0438\u043c\u0435\u043d\u043d\u043e \u0425). \" title=\"\u0420\u0438\u0441.4. \u0412 \u0436\u0435\u043b\u0442\u0443\u044e \u043a\u043b\u0435\u0442\u043a\u0443 \u043f\u0440\u043e\u0441\u0438\u0442\u0441\u044f \u0425 \u0434\u043b\u044f \u043f\u043e\u0431\u0435\u0434\u044b (\u0441\u043f\u0438\u0441\u043e\u043a \u0422\u0422\u0422[8]). \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 mov_map[8] \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0440\u0430\u0441\u043d\u044b\u0439 -1 (\u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0439 \u0431\u0443\u0434\u0443\u0449\u0438\u0439 \u0445\u043e\u0434 \u0438\u043c\u0435\u043d\u043d\u043e \u0425). \" width=\"501\" height=\"302\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/679\/34f\/9fd\/67934f9fdfdd8417df3e4bbf42174acd.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441.4. \u0412 \u0436\u0435\u043b\u0442\u0443\u044e \u043a\u043b\u0435\u0442\u043a\u0443 \u043f\u0440\u043e\u0441\u0438\u0442\u0441\u044f \u0425 \u0434\u043b\u044f \u043f\u043e\u0431\u0435\u0434\u044b (\u0441\u043f\u0438\u0441\u043e\u043a \u0422\u0422\u0422[8]). \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 mov_map[8] \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0440\u0430\u0441\u043d\u044b\u0439 -1 (\u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0439 \u0431\u0443\u0434\u0443\u0449\u0438\u0439 \u0445\u043e\u0434 \u0438\u043c\u0435\u043d\u043d\u043e \u0425). <\/figcaption><\/div>\n<\/figure>\n<ol start=\"2\">\n<li>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0431\u043e\u0440\u043e\u043d\u044f\u0435\u0442\u0441\u044f \u0438\u0433\u0440\u043e\u043a \u041e (<strong>\u0425\u041e=1<\/strong>), \u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u043e\u0431\u0435\u0434\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u0425 \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043b (\u0420\u0438\u0441. 5)? \u0422\u043e\u0433\u0434\u0430  \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0434\u043b\u044f \u0445\u043e\u0434\u0430 \u041e \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0430 \u0436\u0435 \u0436\u0435\u043b\u0442\u0430\u044f \u043a\u043b\u0435\u0442\u043a\u0430 (<strong>mov_map[8]=-1<\/strong>). \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0445\u043e\u0434\u0430 \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043f\u043e\u0431\u0435\u0434\u044b \u0425 \u0438 \u043d\u0438\u0447\u044c\u044f \u0434\u043b\u044f \u0438\u0433\u0440\u043e\u043a\u0430 \u041e:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/ade\/95a\/9ea\/ade95a9ea7d41daa3da1e64ce1ac59e5.jpg\" alt=\"\u0420\u0438\u0441.5. \u0414\u043b\u044f \u0438\u0433\u0440\u043e\u043a\u0430 \u041e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043e\u0440\u043e\u043d\u0430 \u0432 \u0436\u0435\u043b\u0442\u0443\u044e \u043a\u043b\u0435\u0442\u043a\u0443, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 mov_map[8]=-1 (\u0438\u043d\u0430\u0447\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0445\u043e\u0434 \u0425 \u0441\u044e\u0434\u0430 \u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0435\u0433\u043e \u043f\u043e\u0431\u0435\u0434\u0435).\" title=\"\u0420\u0438\u0441.5. \u0414\u043b\u044f \u0438\u0433\u0440\u043e\u043a\u0430 \u041e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043e\u0440\u043e\u043d\u0430 \u0432 \u0436\u0435\u043b\u0442\u0443\u044e \u043a\u043b\u0435\u0442\u043a\u0443, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 mov_map[8]=-1 (\u0438\u043d\u0430\u0447\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0445\u043e\u0434 \u0425 \u0441\u044e\u0434\u0430 \u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0435\u0433\u043e \u043f\u043e\u0431\u0435\u0434\u0435).\" width=\"506\" height=\"301\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ade\/95a\/9ea\/ade95a9ea7d41daa3da1e64ce1ac59e5.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441.5. \u0414\u043b\u044f \u0438\u0433\u0440\u043e\u043a\u0430 \u041e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043e\u0440\u043e\u043d\u0430 \u0432 \u0436\u0435\u043b\u0442\u0443\u044e \u043a\u043b\u0435\u0442\u043a\u0443, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 mov_map[8]=-1 (\u0438\u043d\u0430\u0447\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0445\u043e\u0434 \u0425 \u0441\u044e\u0434\u0430 \u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0435\u0433\u043e \u043f\u043e\u0431\u0435\u0434\u0435).<\/figcaption><\/div>\n<\/figure>\n<ol start=\"3\">\n<li>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0435\u0441\u043b\u0438 \u0432 \u043e\u0434\u043d\u0443 \u043a\u043b\u0435\u0442\u043a\u0443 \u0441\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0434\u0432\u0435 \u043f\u043e\u0431\u0435\u0434\u043d\u044b\u0435 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0438\u0433\u0440\u043e\u043a\u0430 \u0425, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0445\u043e\u0434 \u0438\u0433\u0440\u043e\u043a\u0430 \u041e (<strong>\u0425\u041e=1<\/strong>):<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/532\/8de\/a37\/5328dea3789e636bad0436278d73bbbc.jpg\" alt=\"\u0420\u0438\u0441.6. \u0420\u0435\u0434\u043a\u043e\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435, \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 mov_map[8]=-2. \" title=\"\u0420\u0438\u0441.6. \u0420\u0435\u0434\u043a\u043e\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435, \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 mov_map[8]=-2. \" width=\"523\" height=\"302\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/532\/8de\/a37\/5328dea3789e636bad0436278d73bbbc.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441.6. \u0420\u0435\u0434\u043a\u043e\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435, \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 mov_map[8]=-2. <\/figcaption><\/div>\n<\/figure>\n<ol start=\"4\">\n<li>\n<p>\u041a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043e\u0434\u043d\u0443 \u043a\u043b\u0435\u0442\u043a\u0443 \u0441\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438 \u043f\u043e\u0431\u0435\u0434\u0430 \u0425 \u0438 \u043f\u043e\u0431\u0435\u0434\u0430 \u041e. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043d\u043e\u043b\u044c \u043f\u043e\u0441\u043b\u0435 \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f -1 \u0438 1 \u043b\u0443\u0447\u0448\u0435 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0430 \u0437\u0430\u0442\u0435\u043c \u0443\u043c\u043d\u043e\u0436\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u0438\u0445 \u0437\u043d\u0430\u043a\u0438 (\u043f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0445\u043e\u0442\u044c \u043e\u0434\u0438\u043d \u043c\u0438\u043d\u0443\u0441, \u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u0442\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0432\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u0438 \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u044b \u0432 \u043b\u043e\u0433\u0438\u043a\u0435).<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">def check_moves(): # finding the best cell for the next computer's move     global TTT, move     mov_map = [0, 0, 0, 0, 0, 0, 0, 0, 0] # map of the moves before each computer's move in current situation     move = None     # check for winning rows     # the sum of the moduli of the current value and the winning cell of the checked player, and then multiply them by the sign of the checked player     # in the most cases: zero + 1 or -1 (current player), but if the cell has two or three winners simultaneously, the module of the value must be 2 or 3 (-2 or -3)     for row in range(0, 7, 3):  # jump through 1 in TTT list         r=TTT[row] + TTT[row + 1] + TTT[row + 2]         if abs(r) == 2:             if TTT[row] == 0:                 mov = row                 mov_map[mov] = (abs(mov_map[mov])+abs(int((r) \/ 2)))*int((r) \/ 2) #the sum of winning's module both of players &amp; multiple on the current player's sign             elif TTT[row + 1] == 0:                 mov = row + 1                 mov_map[mov] = (abs(mov_map[mov])+abs(int((r) \/ 2)))*int((r) \/ 2)             elif TTT[row + 2] == 0:                 mov = row + 2                 mov_map[mov] = (abs(mov_map[mov])+abs(int((r) \/ 2)))*int((r) \/ 2)      # check for winning columns     for col in range(0, 3, 1):  # jump through 1 in TTT list         c=TTT[col] + TTT[col + 3] + TTT[col + 6]         if abs(c) == 2:             if TTT[col] == 0:                 mov = col                 mov_map[mov] = (abs(mov_map[mov])+abs(int((c) \/ 2)))*int((c) \/ 2)             elif TTT[col + 3] == 0:                 mov = col + 3                 mov_map[mov] = (abs(mov_map[mov])+abs(int((c) \/ 2)))*int((c) \/ 2)             elif TTT[col + 6] == 0:                 mov = col + 6                 mov_map[mov] = (abs(mov_map[mov]) + abs(int((c) \/ 2))) * int((c) \/ 2)      # check for diagonal winners: L>R     d_Lr=TTT[0] + TTT[4] + TTT[8]     if abs(d_Lr) == 2:         if TTT[0] == 0:             mov = 0             mov_map[mov] = (abs(mov_map[mov])+abs(int((d_Lr) \/ 2)))*int((d_Lr) \/ 2)         elif TTT[4] == 0:             mov = 4             mov_map[mov] = (abs(mov_map[mov])+abs(int((d_Lr) \/ 2)))*int((d_Lr) \/ 2)         elif TTT[8] == 0:             mov = 8             mov_map[mov] = (abs(mov_map[mov])+abs(int((d_Lr) \/ 2)))*int((d_Lr) \/ 2)          # check for diagonal winners: R>L     d_Rl=TTT[2] + TTT[4] + TTT[6]     if abs(d_Rl) == 2:         if TTT[2] == 0:             mov = 2             mov_map[mov] = (abs(mov_map[mov])+abs(int((d_Rl) \/ 2)))*int((d_Rl) \/ 2)         elif TTT[4] == 0:             mov = 4             mov_map[mov] = (abs(mov_map[mov])+abs(int((d_Rl) \/ 2)))*int((d_Rl) \/ 2)         elif TTT[6] == 0:             mov = 6             mov_map[mov] = (abs(mov_map[mov])+abs(int((d_Rl) \/ 2)))*int((d_Rl) \/ 2)<\/code><\/pre>\n<p><strong><u>\u0412\u044b\u0431\u043e\u0440 \u0445\u043e\u0434\u0430<\/u> <\/strong>\u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<strong> <\/strong>\u0441\u043f\u0438\u0441\u043a\u0430<strong> mov_map=[ ]:<\/strong><\/p>\n<p>\u0417\u043d\u0430\u043a \u043f\u0435\u0440\u0435\u0434 \u043c\u043e\u0434\u0443\u043b\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 <strong>mov_map<\/strong> \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0438\u0433\u0440\u043e\u043a\u0430. \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0445\u043e\u0434 \u0425 (\u0442.\u0435. <strong>\u0425\u041e=-1<\/strong>): <\/p>\n<ol>\n<li>\n<p> \u0435\u0441\u043b\u0438 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 <strong>mov_map<\/strong> \u0445\u043e\u0442\u044f \u0431\u044b \u0435\u0434\u0438\u043d\u043e\u0436\u0434\u044b \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f -1, \u0442\u043e \u044d\u0442\u043e \u043f\u043e\u0431\u0435\u0434\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440. <\/p>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 <strong>mov_map<\/strong> -1 \u043d\u0435\u0442, \u0430 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 1, \u0442\u043e \u0434\u043b\u044f \u0425 (\u043d\u0430\u043f\u043e\u043c\u043d\u044e, \u0425\u041e=-1) \u044d\u0442\u043e \u0445\u043e\u0434 \u0434\u043b\u044f \u0441\u043f\u0430\u0441\u0435\u043d\u0438\u044f \u043e\u0442 \u043f\u043e\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 <strong>mov_map <\/strong>\u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0438 -1 \u0438 1, \u0442\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u0437\u043d\u0430\u043a\u043e\u043c \u0434\u043b\u044f \u043f\u043e\u0431\u0435\u0434\u044b (\u0442.\u0435. -1 \u0434\u043b\u044f \u0425\u041e=-1<strong>)<\/strong>.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\"># if one winner in one cell     if mov_map.count(XO) > 0 and mov_map.count(-1*XO) == 0: #current player must choose his own square if the opponent hasn't a winning cell         move = mov_map.index(XO)     if mov_map.count(-1*XO) > 0 and mov_map.count(XO) == 0: #current player must choose opponent's square if the there isn't his own winning cell         move = mov_map.index(-1*XO)     if mov_map.count(XO) > 0 and mov_map.count(-1*XO) > 0: # current player must choose his own square if the opponent has a winning cell as well         move = mov_map.index(XO)<\/code><\/pre>\n<ol start=\"4\">\n<li>\n<p>\u0412\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u0430\u043a\u043e\u0439 \u0438\u0433\u0440\u043e\u043a (\u0425 \u0438\u043b\u0438 \u041e): \u043b\u044e\u0431\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c 2 (\u0438\u043b\u0438 3 &#8212; \u0442\u0430\u043a\u043e\u0435 \u0442\u043e\u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e!) \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0445\u043e\u0434\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0443\u0434\u0430. \u0422\u0430\u043c \u0441\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0438\u043b\u0438 \u0434\u0432\u0435 \u043f\u043e\u0431\u0435\u0434\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0433\u0440\u043e\u043a\u0430, \u0438\u043b\u0438 \u043f\u043e\u0431\u0435\u0434\u0430 \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\"># if two or three winners are in one cell - the always preference goes to current player     if mov_map.count(2) > 0:         move = mov_map.index(2)     if mov_map.count(-2) > 0:         move = mov_map.index(-2)     if mov_map.count(3) > 0:         move = mov_map.index(3)     if mov_map.count(-3) > 0:         move = mov_map.index(-3)<\/code><\/pre>\n<h3>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0418\u0433\u0440\u043e\u043a\u0430<\/h3>\n<p>\u0420\u0430\u0437\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438\u0433\u0440\u044b \u0434\u043b\u044f \u0425- \u0438\u043b\u0438 \u041e- \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043d\u0430 \u043e\u0442\u043b\u0430\u0434\u043a\u0435 \u0432\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u0438 \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u044b \u0438 \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043a\u0438.<\/p>\n<p><strong>X_player()<\/strong>. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0446\u0438\u043a\u043b <strong>while True <\/strong>\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432\u044b\u0445\u043e\u0434\u0430 \u0438\u0437 \u0438\u0433\u0440\u044b (\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0446\u0438\u043a\u043b<strong> for event&#8230; <\/strong>\u0432<strong> pygame<\/strong>). <\/p>\n<pre><code class=\"python\">def X_player(): # X-player     global TTT, XO, move, winner, draw     while (True):  # run the game loop forever         for event in pg.event.get():             if event.type == QUIT:                 pg.quit()                 sys.exit()<\/code><\/pre>\n<p>\u041e\u0434\u0438\u043d \u0445\u043e\u0434 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0433\u0440\u043e\u043a\u0430 &#8212; \u044d\u0442\u043e \u0434\u0432\u0435 \u0432\u0435\u0442\u043a\u0438:<\/p>\n<ol>\n<li>\n<p>\u0418\u0433\u0440\u043e\u043a \u0425 &#8212; \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c &#8212; (<strong>\u0425\u041e==-1<\/strong>) \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u043c\u044b\u0448\u043a\u043e\u0439 \u0436\u0435\u043b\u0430\u0435\u043c\u0443\u044e \u043a\u043b\u0435\u0442\u043a\u0443 \u043d\u0430 \u043f\u043e\u043b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <strong>user_click()<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0442 0 \u0434\u043e 8 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <strong>move <\/strong>(\u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0445\u0435\u043c\u0435 \u043d\u0430 \u0440\u0438\u0441.1). \u0415\u0441\u043b\u0438 <strong>move=None<\/strong>, \u0437\u043d\u0430\u0447\u0438\u0442 \u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0439 \u043a\u043b\u0438\u043a. \u0423\u0434\u043e\u0431\u043d\u043e \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0431\u0435\u0437 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u043e\u043c\u0430\u0445\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0438\u043c\u043e \u043f\u043e\u043b\u044f,<strong> <\/strong>\u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0432 \u044d\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432 \u0446\u0438\u043a\u043b\u0435 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u043e\u043c (<strong><em>continue<\/em><\/strong>). <\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0436\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0443\u043a\u0430\u0437\u0430\u043b \u043f\u0443\u0441\u0442\u0443\u044e \u043a\u043b\u0435\u0442\u043a\u0443 <strong>TTT[move] == 0<\/strong>, \u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0440\u0438\u0441\u043e\u0432\u043a\u0438<strong> <\/strong>\u0444\u0438\u0433\u0443\u0440\u044b \u043d\u0430 \u043f\u043e\u043b\u0435<strong> DrawXO() <\/strong>(\u0441\u043c. \u043d\u0438\u0436\u0435).<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">            if XO == -1: # X's move                 if event.type == MOUSEBUTTONDOWN:                     user_click()  # click mouse button for \u0425's move                     if move == None:                         continue                     else:                         if (TTT[move] == 0):                             DrawXO()<\/code><\/pre>\n<ol start=\"3\">\n<li>\n<p>\u0418\u0433\u0440\u043e\u043a \u041e &#8212; \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 &#8212; (<strong>\u0425\u041e==1<\/strong>):<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0445\u043e\u0434\u043e\u0432: <strong>check_moves()<\/strong>. \u0415\u0441\u043b\u0438 \u0438\u0445 \u043d\u0435\u0442, \u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0446\u0438\u043a\u043b <strong>while True<\/strong>: <\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c &#171;\u041e&#187; \u0432 \u0446\u0435\u043d\u0442\u0440 <strong>TTT[4] == 0<\/strong> (&#171;\u0437\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 \u0434\u0443\u0440\u0430\u043a\u0430&#187;, \u0442.\u043a.  \u044d\u0442\u043e \u043e\u0441\u043b\u0430\u0431\u0438\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0443 \u0425 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0445\u043e\u0434\u0430). <\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 &#8212; \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u0445\u043e\u0434 &#171;\u041e&#187;, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u0443\u0441\u0442\u043e\u0435 \u043c\u0435\u0441\u0442\u043e: <strong>random<\/strong>. <\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0440\u0438\u0441\u043e\u0432\u043a\u0430, \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0445\u043e\u0434\u0430 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430<strong> \u0432 DrawXO() <\/strong>(\u0441\u043c. \u043d\u0438\u0436\u0435).<strong> <\/strong><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">            if XO == 1 and draw is False and winner is None: # O's move                 check_moves()  # check for XX, X_X, OO, O_O                 if move is None:                     while True:                         if TTT[4] == 0:  # protection from the fool (when a rival makes typical triangle of \"X\")                             move = 4                             break                         else:  # a move for good luck, gives a chance to play fair without algorithm                             move = random.randint(0, 8)                             if TTT[move] == 0:                                 break                 DrawXO()<\/code><\/pre>\n<ol start=\"4\">\n<li>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0447\u044c\u0435\u0439-\u0442\u043e \u043f\u043e\u0431\u0435\u0434\u044b \u0438\u043b\u0438 \u043d\u0438\u0447\u044c\u0438 &#8212; \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430<strong> reset_game()<\/strong>. <\/p>\n<\/li>\n<li>\n<p>\u0412 \u0433\u043b\u0430\u0432\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 <strong>pg.display.update()<\/strong>.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">        if (winner or draw):             reset_game()         pg.display.update()         CLOCK.tick(fps)<\/code><\/pre>\n<p><strong>DrawXO(). <\/strong><em>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0438\u043c\u0435\u044e\u0449\u0435\u043c\u0441\u044f \u0433\u043e\u0442\u043e\u0432\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 \u0445\u043e\u0434\u0430 <\/em><strong>move<\/strong><em>.<\/em> <\/p>\n<ul>\n<li>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u043d\u043e\u0441\u0438\u0442 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u043e\u0432\u044b\u0439 \u0445\u043e\u0434: <strong>TTT[move] = XO<\/strong>. <\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0425 (\u0438\u043b\u0438 \u041e) \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u043e\u043b\u0435. <\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e <strong>XO = -1*XO <\/strong>\u0434\u0430\u0435\u0442 \u0442\u0440\u0438\u0433\u0435\u0440 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0445\u043e\u0434\u0430 (\u043e\u0442 \u0425 \u043a \u041e \u0438\u043b\u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442), \u043c\u0435\u043d\u044f\u044f \u0441\u0432\u043e\u0439 \u0437\u043d\u0430\u043a \u043d\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439. <\/p>\n<\/li>\n<li>\n<p>\u0412 \u0444\u0438\u043d\u0430\u043b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0432\u0441\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043f\u043e\u043b\u0435 <strong>\u0422\u0422\u0422<\/strong> \u043d\u0430 \u043f\u043e\u0431\u0435\u0434\u0443 <strong>check_win()<\/strong>.<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"python\">def DrawXO(): # drawing of X or O, and after a sign will be reversed (XO => - XO) for player changing     global TTT, XO, move     TTT[move] = XO     if move == 0:         posx = 30         posy = 30     if move == 1:         posx = width \/ 3 + 30         posy = 30     if move == 2:         posx = width \/ 3 * 2 + 30         posy = 30      if move == 3:         posx = 30         posy = height \/ 3 + 30     if move == 4:         posx = width \/ 3 + 30         posy = height \/ 3 + 30     if move == 5:         posx = width \/ 3 * 2 + 30         posy = height \/ 3 + 30      if move == 6:         posx = 30         posy = height \/ 3 * 2 + 30     if move == 7:         posx = width \/ 3 + 30         posy = height \/ 3 * 2 + 30     if move == 8:         posx = width \/ 3 * 2 + 30         posy = height \/ 3 * 2 + 30      if XO == -1:         screen.blit(x_img, (posx, posy))     else:         screen.blit(o_img, (posx, posy))     XO = -1*XO     pg.display.update()     check_win()<\/code><\/pre>\n<p><strong><em>\u041e\u0434\u0438\u043d \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0446\u0438\u043a\u043b X_player() \u044d\u0442\u043e:<\/em><\/strong> <\/p>\n<ol>\n<li>\n<p>\u0445\u043e\u0434 \u0425 (\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c), \u043f\u0440\u043e\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u0438 \u0441\u043c\u0435\u043d\u0430 \u0438\u0433\u0440\u043e\u043a\u0430, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u043f\u043e\u0431\u0435\u0434\u0443.<\/p>\n<\/li>\n<li>\n<p>\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0438\u0441\u043a\u0430 \u0445\u043e\u0434\u0430 \u0434\u043b\u044f \u041e (\u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440), \u043f\u0440\u043e\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u0438 \u0441\u043c\u0435\u043d\u0430 \u0438\u0433\u0440\u043e\u043a\u0430, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u043f\u043e\u0431\u0435\u0434\u0443.<\/p>\n<\/li>\n<\/ol>\n<p><strong>O_player(). <\/strong>\u0423\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043d\u043e \u0437\u0435\u0440\u043a\u0430\u043b\u044c\u043d\u043e \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442.<\/p>\n<h3>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430?<\/h3>\n<p>\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f &#8212; \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0433\u043e \u0445\u043e\u0434\u0430 &#8212; \u044d\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u043d\u044b\u0435 \u0448\u0430\u043d\u0441\u044b \u0434\u043b\u044f \u043f\u043e\u0431\u0435\u0434\u044b \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430. \u041d\u0430 \u043f\u043e\u043b\u0435 3\u04453 \u0432\u0430\u0436\u043d\u044b \u043f\u0435\u0440\u0432\u044b\u0435 \u0442\u0440\u0438 \u0445\u043e\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u041e-\u0438\u0433\u0440\u043e\u043a \u043c\u0435\u0448\u0430\u0435\u0442 \u0425 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0438\u043b\u043a\u0443, \u0442.\u0435. \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0432\u0435 \u043a\u043b\u0435\u0442\u043a\u0438 \u0434\u043b\u044f \u0431\u0435\u0437\u043e\u0433\u043e\u0432\u043e\u0440\u043e\u0447\u043d\u043e\u0439 \u043f\u043e\u0431\u0435\u0434\u044b \u0425 (\u0420\u0438\u0441.7).<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/82e\/fba\/b82\/82efbab82b662fd551999b83e691d16b.jpg\" alt=\"\u0420\u0438\u0441.7. \u0418\u0433\u0440\u043e\u043a \u0425 \u0441\u0434\u0435\u043b\u0430\u043b \u0432\u0438\u043b\u043a\u0443. \u0425\u043e\u0434 \u041e-\u0438\u0433\u0440\u043e\u043a\u0430 \u0432 \u043a\u0440\u0430\u0441\u043d\u0443\u044e \u0438\u043b\u0438 \u0436\u0435\u043b\u0442\u0443\u044e \u043a\u043b\u0435\u0442\u043a\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u043f\u043e\u0431\u0435\u0434\u0435 \u0425.\" title=\"\u0420\u0438\u0441.7. \u0418\u0433\u0440\u043e\u043a \u0425 \u0441\u0434\u0435\u043b\u0430\u043b \u0432\u0438\u043b\u043a\u0443. \u0425\u043e\u0434 \u041e-\u0438\u0433\u0440\u043e\u043a\u0430 \u0432 \u043a\u0440\u0430\u0441\u043d\u0443\u044e \u0438\u043b\u0438 \u0436\u0435\u043b\u0442\u0443\u044e \u043a\u043b\u0435\u0442\u043a\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u043f\u043e\u0431\u0435\u0434\u0435 \u0425.\" width=\"529\" height=\"318\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/82e\/fba\/b82\/82efbab82b662fd551999b83e691d16b.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441.7. \u0418\u0433\u0440\u043e\u043a \u0425 \u0441\u0434\u0435\u043b\u0430\u043b \u0432\u0438\u043b\u043a\u0443. \u0425\u043e\u0434 \u041e-\u0438\u0433\u0440\u043e\u043a\u0430 \u0432 \u043a\u0440\u0430\u0441\u043d\u0443\u044e \u0438\u043b\u0438 \u0436\u0435\u043b\u0442\u0443\u044e \u043a\u043b\u0435\u0442\u043a\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u043f\u043e\u0431\u0435\u0434\u0435 \u0425.<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0434\u0435\u0431\u044e\u0442\u043e\u0432 &#171;\u043e\u0442 \u0432\u0438\u043b\u043a\u0438&#187; (\u0438\u0445 \u0442\u0440\u0438), \u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u0442\u0430\u043d\u0435\u0442 \u043c\u043e\u0449\u043d\u0435\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u043e\u043a\u043e\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e &#171;\u0437\u0430\u0441\u0443\u0448\u0438\u0442&#187; \u0438\u0433\u0440\u0443 \u0434\u043e \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0439 \u043d\u0438\u0447\u044c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443 \u0434\u0435\u0442\u0435\u0439 \u043f\u0440\u043e\u043f\u0430\u0434\u0435\u0442 \u0432\u0441\u044f\u043a\u0438\u0439 \u0430\u0437\u0430\u0440\u0442 \u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0441\u044b\u0433\u0440\u0430\u0442\u044c (\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b \u043d\u0430 \u0441\u0432\u043e\u0438\u0445). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0435\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e &#171;\u0437\u0430\u0449\u0438\u0442\u0443 \u043e\u0442 \u0434\u0443\u0440\u0430\u043a\u0430&#187; \u0432 \u0432\u0438\u0434\u0435 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 &#171;\u041e&#187; \u0432 \u0446\u0435\u043d\u0442\u0440, \u0447\u0442\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u043b\u043e \u0448\u0430\u043d\u0441\u044b \u0434\u043b\u044f \u043f\u043e\u0431\u0435\u0434\u044b &#171;\u0425&#187;, \u043d\u043e \u043d\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u043b\u043e \u0438\u0445. \u041b\u0438\u0431\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u0436\u0435 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0440\u0430\u0434\u0438 \u0430\u0437\u0430\u0440\u0442\u0430.<\/p>\n<h3>\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434<\/h3>\n<p>\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u043c\u0435\u043d\u044e \u0438 \u0432\u044b\u0431\u043e\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0440\u043e\u043b\u0438 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u043e\u0441\u044c, \u0442\u0430\u043c \u0432\u0441\u0435 \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u0442\u0440\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0430\u0440\u0445\u0438\u0432\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 <a href=\"https:\/\/drive.google.com\/file\/d\/1J7TRYebLjVai0doL5NV4nEZcueDcIMec\/view?usp=sharing\" rel=\"noopener noreferrer nofollow\"><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a>. <\/p>\n<h3>\u0410\u043d\u043e\u043d\u0441 \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438<\/h3>\n<ol>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u0438\u0433\u0440 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u043f\u0440\u043e\u0442\u0438\u0432 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0432\u0441\u0435\u0445 \u0438\u0433\u0440 \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e \u0432 CSV-\u0444\u0430\u0439\u043b.<\/p>\n<\/li>\n<li>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437 \u0438 \u0432\u044b\u0431\u043e\u0440 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0445\u043e\u0434\u0430 \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445: \u043a\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u0435\u043d? <\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b: \u044d\u0442\u043e \u043b\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435?<\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/748586\/\"> https:\/\/habr.com\/ru\/articles\/748586\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442. \u042f \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044c Python \u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0434\u043e\u043b\u0433\u043e \u043e\u0441\u0432\u0430\u0438\u0432\u0430\u044e \u044f\u0437\u044b\u043a \u0432\u0441\u0435\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. \u041c\u043e\u044f \u0446\u0435\u043b\u044c &#8212; \u043f\u043e\u043d\u044f\u0442\u044c \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u0435\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u044c \u0441 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c\u044e. \u041d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u0430 \u0432 IT \u043d\u0435 \u0438\u043c\u0435\u043b, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0438\u0437\u043b\u0430\u0433\u0430\u0442\u044c \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u043e\u0439 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043b\u043e\u0433\u0438\u0435\u0439, \u043d\u0435 \u0441\u0443\u0434\u0438\u0442\u0435 \u0441\u0442\u0440\u043e\u0433\u043e. \u041c\u043e\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u0430\u044f, \u0434\u0430\u043b\u0435\u043a\u0430 \u043e\u0442 IT, \u043d\u043e \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u043d\u0435\u0435 \u0432\u0441\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u043d\u0435\u0434\u0440\u044f\u044e\u0442\u0441\u044f AI \u0438 ML. \u041c\u043d\u043e\u044e \u0434\u0432\u0438\u0436\u0435\u0442 \u043b\u0438\u0448\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u043a \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f\u043c, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e.<\/p>\n<p>\u0412 <strong>\u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/strong> \u043f\u043e\u043a\u0430\u0436\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u044d\u0442\u0430\u043f\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u0433\u0440\u044b, \u0433\u0434\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0440\u043e\u043b\u044c (\u0425 \u0438\u043b\u0438 \u041e), \u0438\u0433\u0440\u0430\u044f \u0441 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c. \u041f\u043e\u0438\u0441\u043a \u0432 \u0441\u0435\u0442\u0438 Python \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432 \u0434\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0438\u0433\u0440\u044b \u0441 \u0440\u0430\u043d\u0434\u043e\u043c\u043d\u044b\u043c \u043e\u0442\u0432\u0435\u0442\u043e\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430. \u041c\u043e\u0439 \u0446\u0435\u043b\u044c\u044e \u0432 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u043b\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u043d\u0430 \u043f\u043e\u043b\u0435 &#171;\u041a\u0440\u0435\u0441\u0442\u0438\u043a\u0438-\u041d\u043e\u043b\u0438\u043a\u0438&#187; \u0438 \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0445\u043e\u0434\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430. \u041a \u0441\u043b\u043e\u0432\u0443, \u0443\u0436\u0435 \u043f\u0435\u0440\u0435\u0434 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435\u043c \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0430\u0448\u0435\u043b \u0433\u043e\u0442\u043e\u0432\u0443\u044e web-\u0438\u0433\u0440\u0443 \u0432 google, \u0433\u0434\u0435 \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434. \u0422\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0435\u0431\u044f \u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f &#171;\u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043b\u0435\u0441\u0430, \u043d\u043e \u043f\u043e-\u0441\u0432\u043e\u0435\u043c\u0443&#187;. <\/p>\n<p>\u0412\u043e <strong>\u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/strong> \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u043a \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0435 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 &#8212; \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0441\u044b\u0433\u0440\u0430\u043d\u043d\u044b\u0445 \u043f\u0430\u0440\u0442\u0438\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c \u0441 \u0441\u0430\u043c\u0438\u043c \u0441\u043e\u0431\u043e\u0439.<\/p>\n<p><strong>\u041a\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b:<\/strong> \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044f\u043c Python, \u043b\u043e\u0433\u0438\u043a\u0438, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432. \u0412 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u0440\u043e\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c.<\/p>\n<p><strong>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438:<\/strong><\/p>\n<ol>\n<li>\n<p>\u0417\u0430\u0447\u0435\u043c \u041a\u0440\u0435\u0441\u0442\u0438\u043a\u0430\u043c\u2011\u041d\u043e\u043b\u0438\u043a\u0430\u043c \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435?<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044f 3\u04453 \u0432 \u0432\u0438\u0434\u0435 \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0440\u043e\u0442\u043a\u043e \u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445.<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u0440\u0442\u0430 \u043b\u0443\u0447\u0448\u0438\u0445 \u0445\u043e\u0434\u043e\u0432 \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0418\u0433\u0440\u043e\u043a\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430?<\/p>\n<\/li>\n<li>\n<p>\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<\/li>\n<li>\n<p>\u0410\u043d\u043e\u043d\u0441 \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438<\/p>\n<\/li>\n<\/ol>\n<h3>\u0417\u0430\u0447\u0435\u043c \u041a\u0440\u0435\u0441\u0442\u0438\u043a\u0430\u043c\u2011\u041d\u043e\u043b\u0438\u043a\u0430\u043c \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435?<\/h3>\n<p>\u041e\u0442\u0432\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439: \u0448\u0430\u0445\u043c\u0430\u0442\u044b \u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0418\u0418. \u042d\u0442\u0438 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432 \u0436\u0438\u0437\u043d\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0443\u0442\u0438 &#8212; \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0438\u0433\u0440\u0430. \u041a\u0430\u043a \u043c\u043d\u0435 \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0432\u0441\u0435 \u0445\u043e\u0434\u044b \u043a\u0430\u043a \u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b \u043f\u0440\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u0434\u0432\u0438\u0436\u043e\u043a \u043d\u0430 CHESS.com \u043f\u043e\u0440\u0430\u0436\u0430\u0435\u0442, \u043a\u0430\u043a \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 DEEP-L. \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0432\u0441\u0435 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0448\u0430\u0445\u043c\u0430\u0442\u043d\u044b\u0435 \u043f\u0430\u0440\u0442\u0438\u0438 \u0441 XIX \u0432\u0435\u043a\u0430 \u0432\u043d\u0435\u0441\u043b\u0438 \u0432 \u0431\u0430\u0437\u0443 \u0418\u0418 (\u0431\u043b\u0430\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u0438\u0445 \u0432 \u0432\u0438\u0434\u0435 \u0448\u0430\u0445\u043c\u0430\u0442\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0443\u043b). \u0417\u0430\u0442\u0435\u043c \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u043c\u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u043f\u043e\u0438\u0441\u043a \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u043e\u0434\u0430. \u0412\u044b\u044f\u0441\u043d\u0438\u043b\u0438, \u0447\u0442\u043e \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0430\u0442\u044c, \u0432\u0435\u0434\u044c \u0448\u0430\u0445\u043c\u0430\u0442\u0438\u0441\u0442\u044b \u0440\u0430\u0441\u0442\u0443\u0442 \u0434\u0430 \u0438 \u0438\u0433\u0440\u0430\u0435\u0442 \u0443\u0436\u0435 \u0432\u0435\u0441\u044c \u043c\u0438\u0440. \u0410 \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0430\u0440\u0442\u0438\u0439, \u0442\u0435\u043c \u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u0435\u0435 \u0438\u0445 \u0430\u043d\u0430\u043b\u0438\u0437 (\u0445\u043e\u0442\u044c \u0438 \u0434\u043e\u043b\u044c\u0448\u0435). \u041f\u0440\u0438\u0434\u0443\u043c\u0430\u043b\u0438 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e \u043f\u043e\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0448\u0430\u0445\u043c\u0430\u0442\u043d\u0443\u044e \u0431\u0430\u0437\u0443 \u0432 \u0418\u0418, \u0441\u043d\u043e\u0432\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043b\u0443\u0447\u0448\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0445\u043e\u0434\u0430, \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044f \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0438 \u043f\u043e\u0438\u0441\u043a\u0430. \u0422\u0430\u043a \u044f \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0443\u044e \u0438\u0433\u0440\u0443, \u0433\u0434\u0435 \u043c\u0430\u0448\u0438\u043d\u0443 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u0434\u043e \u0438\u0434\u0435\u0430\u043b\u0430 \u043f\u043e \u044d\u0442\u043e\u0439 \u0441\u0445\u0435\u043c\u0435. \u0412\u044b\u0431\u043e\u0440 \u043f\u0430\u043b Tic Tac Toe \u0441 \u043f\u043e\u043b\u0435\u043c 3\u04453. \u041d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0435\u0449\u0435 \u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441 \u043d\u0443\u043b\u044f. \u041e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043b \u0441\u0435\u0431\u0435 \u044d\u0442\u0430\u043f\u044b Machine Learning (\u0442\u0435\u043c\u0430 <strong>\u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/strong>): <\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0418\u0418 \u0443\u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0438\u0433\u0440, <\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0438 \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u043e\u0442\u0431\u043e\u0440\u0430 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u043e\u0434\u0430.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044f 3\u04453 \u0432 \u0432\u0438\u0434\u0435 \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430<\/h3>\n<p>\u042f \u0440\u0435\u0448\u0438\u043b \u0443\u0439\u0442\u0438 \u043e\u0442 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 list, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044f. \u0418\u0433\u0440\u043e\u043a\u0430 &#171;\u0425&#187; \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043b \u043a\u0430\u043a &#171;-1&#187;, &#171;\u041e&#187; \u043a\u0430\u043a &#171;1&#187;. \u041d\u0435\u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f &#171;0&#187;. \u042d\u0442\u043e  \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0439 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430\u0448\u0430 \u0438\u0433\u0440\u0430 &#8212; \u044d\u0442\u043e \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441 9\u044e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044f\u0445 \u043e\u0442 0 \u0434\u043e 8, \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u0430\u0447\u0430\u043b\u043e: <strong>TTT=[0, 0, 0, 0, 0, 0, 0, 0, 0]<\/strong>  (\u0440\u0438\u0441. 1 \u0438 2):<\/p>\n<figure class=\"\">\n<div><figcaption>\u0420\u0438\u0441. 1. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0440\u0430\u0432\u043d\u0430 \u043a\u043b\u0435\u0442\u043a\u0435 \u043d\u0430 \u043f\u043e\u043b\u0435 3\u04453. \u041d\u0430\u0447\u0430\u043b\u043e \u0438\u0433\u0440\u044b: TTT=[0, 0, 0, 0, 0, 0, 0, 0, 0]<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\">\n<div><figcaption>\u0420\u0438\u0441. 2. \u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043f\u0438\u0441\u043a\u0430, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043f\u043e\u043b\u0435 <u>TTT=[-1, 0, 1, 0, -1, 0, 0, 0, 1]<\/u>.<\/figcaption><\/div>\n<\/figure>\n<h3>\u041a\u043e\u0440\u043e\u0442\u043a\u043e \u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445<\/h3>\n<p>\u0418\u0433\u0440\u0430 \u0438\u043c\u0435\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0438\u0433\u0440\u043e\u0432\u044b\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435.<\/p>\n<p><strong>pygame:<\/strong> \u0412\u044b\u0431\u0440\u0430\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043e\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u043f\u043e\u043b\u0447\u0430\u0441\u0430 \u0441 \u0433\u0443\u0433\u043b. <\/p>\n<pre><code class=\"python\">import pygame as pg, sys from pygame.locals import * import time, random  width = 400 height = 400 white = (255, 255, 255) RED = (255, 0, 0) BLACK = (0, 0, 0) line_color = (10, 10, 10)  # initializing pygame window pg.init() fps = 30 CLOCK = pg.time.Clock() screen = pg.display.set_mode((width, height + 100), 0, 32) pg.display.set_caption(\"Tic Tac Toe\")  # loading the images opening = pg.image.load('tic tac opening.png') x_img = pg.image.load('x.png') o_img = pg.image.load('o.png')  # resizing images x_img = pg.transform.scale(x_img, (80, 80)) o_img = pg.transform.scale(o_img, (80, 80)) opening = pg.transform.scale(opening, (width, height + 100))<\/code><\/pre>\n<p><strong>user_click():<\/strong> \u0412\u044b\u0431\u043e\u0440 \u043c\u044b\u0448\u043a\u043e\u0439 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0431\u0435\u0437 \u0438\u0437\u044b\u0441\u043a\u043e\u0432: \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u043a\u0442\u043e\u0440\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0435\u0433\u043e \u043d\u043e\u043c\u0435\u0440 \u043a\u0430\u043a \u043d\u0430 \u0440\u0438\u0441.1., \u0447\u0442\u043e \u0437\u0430\u043b\u043e\u0436\u0435\u043d\u043e \u0432 \u0447\u0438\u0441\u043b\u043e\u0432\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong><u>move<\/u><\/strong>. <\/p>\n<pre><code class=\"python\">def user_click(): # mouse click     global move     move = None     # get coordinates of mouse click     x, y = pg.mouse.get_pos()     # get x,y of mouse click (cell 0-8)     if (y &lt; height \/ 3) and (x &lt; width \/ 3):         move = 0     elif (y &lt; height \/ 3) and (x &lt; width \/ 3 * 2):         move = 1     elif (y &lt; height \/ 3) and (x &lt; width):         move = 2      elif (y &lt; height \/ 3 * 2) and (x &lt; width \/ 3):         move = 3     elif (y &lt; height \/ 3 * 2) and (x &lt; width \/ 3 * 2):         move = 4     elif (y &lt; height \/ 3 * 2) and (x &lt; width):         move = 5      elif (y &lt; height) and (x &lt; width \/ 3):         move = 6     elif (y &lt; height) and (x &lt; width \/ 3 * 2):         move = 7     elif (y &lt; height) and (x &lt; width):         move = 8<\/code><\/pre>\n<p><strong>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435:<\/strong>  <strong>XO <\/strong>&#8212; \u044d\u0442\u043e<strong> <\/strong>\u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0425 (-1) \u0438\u043b\u0438 \u041e (1) \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 <strong>TTT=[  ]<\/strong>.<strong> <\/strong>\u041f\u0435\u0440\u043c\u0435\u043d\u043d\u044b\u0435 <strong>\u0425\u041e<\/strong> \u0438 <strong>move<\/strong> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <strong><em>None<\/em><\/strong>, \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435<u>,<\/u> \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445. \u0413\u043e\u0432\u043e\u0440\u044f\u0449\u0438\u0435 \u0437\u0430 \u0441\u0435\u0431\u044f <strong>winner<\/strong> \u0438 <strong>draw<\/strong> &#8212; \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u044c \u0438 \u043d\u0438\u0447\u044c\u044f.<\/p>\n<pre><code class=\"python\">XO = None  # -1 is X-player, 1 is O-player move = None # numbers from 0 to 8 winner = None draw = False      # TicTacToe 3x3 board TTT= [0,0,0,0,0,0,0,0,0]     # game field is shared on 9 cells with determination of each one from left to right in upper,middle &amp; lower row:     # 0,1,2 - upper row     # 3,4,5 - middle row     # 6,7,8 - lower row     # totaly = 3x3 field = 9 numbers (from 0 to 8 considering that list [TTT] starts with 0 position)<\/code><\/pre>\n<p><strong>\u0441heck_win():<\/strong>  \u041f\u0435\u0440\u0435\u0431\u043e\u0440\u043e\u043c \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0439 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044f \u0422\u0422\u0422 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0440\u0438 -1 \u0438\u043b\u0438 1 \u0432 \u0440\u044f\u0434\u0443 (\u043d\u043e \u0438 \u043d\u0435 \u043d\u043e\u043b\u044c!), \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438 \u0438\u043b\u0438 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0438\u0441\u0443\u0435\u0442 \u043b\u0438\u043d\u0438\u044e \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0431\u0435\u0434\u043d\u0443\u044e \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044e \u0438 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 winner \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 -1 (\u0425) \u0438\u043b\u0438 1 (\u041e).  <\/p>\n<figure class=\"\">\n<div><figcaption>\u0420\u0438\u0441.3. \u0414\u0432\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0431\u0435\u0434 \u0438 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u0432\u0438\u0434 \u0441\u043f\u0438\u0441\u043a\u0430 \u0422\u0422\u0422 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c.<\/figcaption><\/div>\n<\/figure>\n<pre><code class=\"python\">def check_win(): # check winner and drawing the appropriate lines     global TTT, winner, draw      # check for winning rows     for row in range(0, 7, 3):  # jump through 3 in TTT list         if ((TTT[row] == TTT[row + 1] == TTT[row + 2]) and (TTT[row] != 0)):             # this row won             winner = TTT[row]             pg.draw.line(screen, (250, 0, 0), (0, (row\/3 + 1) * height \/ 3 - height \/ 6), \\                          (width, (row\/3 + 1) * height \/ 3 - height \/ 6), 6)             break      # check for winning columns     for col in range(0, 3, 1):  # jump through 1 in TTT list         if (TTT[col] == TTT[col + 3] == TTT[col + 6]) and (TTT[col] != 0):             # this column won             winner = TTT[col]             # draw winning line             pg.draw.line(screen, (250, 0, 0), ((col + 1) * width \/ 3 - width \/ 6, 0), \\                          ((col + 1) * width \/ 3 - width \/ 6, height), 6)             break      # check for diagonal winners     if (TTT[0] == TTT[4] == TTT[8]) and (TTT[0] != 0):         # game won diagonally left to right         winner = TTT[0]         pg.draw.line(screen, (250, 70, 70), (50, 50), (350, 350), 6)      if (TTT[2] == TTT[4] == TTT[6]) and (TTT[2] != 0):         # game won diagonally right to left         winner = TTT[2]         pg.draw.line(screen, (250, 70, 70), (350, 50), (50, 350), 6)      if TTT.count(0) == 0 and winner is None:  # all cells are filled in         draw = True      game_status()<\/code><\/pre>\n<h3>\u041a\u0430\u0440\u0442\u0430 \u043b\u0443\u0447\u0448\u0438\u0445 \u0445\u043e\u0434\u043e\u0432 \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430<\/h3>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e &#8212; \u044d\u0442\u043e \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435. \u042f \u0440\u0435\u0448\u0438\u043b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0441\u043f\u0438\u0441\u043e\u043a  <strong>mov_map<\/strong>  \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044f. \u0421\u044e\u0434\u0430 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0443\u0436\u043d\u044b\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0445\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u0431\u0435\u0434\u044b. \u041f\u0430\u0440\u0443 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 (\u0420\u0438\u0441.4.), \u043a\u043e\u0433\u0434\u0430 \u043d\u0430 7\u043c \u0445\u043e\u0434\u0443 \u0425 (<strong>\u0425\u041e=-1<\/strong>) \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0443\u0434\u0430, \u0433\u0434\u0435 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0425\u0425 \u0440\u044f\u0434\u043e\u043c \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c (\u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u044c \u041b\u0435\u0432\u043e-\u041f\u0440\u0430\u0432\u043e):<\/p>\n<\/li>\n<\/ol>\n<figure class=\"\">\n<div><figcaption>\u0420\u0438\u0441.4. \u0412 \u0436\u0435\u043b\u0442\u0443\u044e \u043a\u043b\u0435\u0442\u043a\u0443 \u043f\u0440\u043e\u0441\u0438\u0442\u0441\u044f \u0425 \u0434\u043b\u044f \u043f\u043e\u0431\u0435\u0434\u044b (\u0441\u043f\u0438\u0441\u043e\u043a \u0422\u0422\u0422[8]). \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 mov_map[8] \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0440\u0430\u0441\u043d\u044b\u0439 -1 (\u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0439 \u0431\u0443\u0434\u0443\u0449\u0438\u0439 \u0445\u043e\u0434 \u0438\u043c\u0435\u043d\u043d\u043e \u0425). <\/figcaption><\/div>\n<\/figure>\n<ol start=\"2\">\n<li>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0431\u043e\u0440\u043e\u043d\u044f\u0435\u0442\u0441\u044f \u0438\u0433\u0440\u043e\u043a \u041e (<strong>\u0425\u041e=1<\/strong>), \u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u043e\u0431\u0435\u0434\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u0425 \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043b (\u0420\u0438\u0441. 5)? \u0422\u043e\u0433\u0434\u0430  \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0434\u043b\u044f \u0445\u043e\u0434\u0430 \u041e \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0430 \u0436\u0435 \u0436\u0435\u043b\u0442\u0430\u044f \u043a\u043b\u0435\u0442\u043a\u0430 (<strong>mov_map[8]=-1<\/strong>). \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0445\u043e\u0434\u0430 \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043f\u043e\u0431\u0435\u0434\u044b \u0425 \u0438 \u043d\u0438\u0447\u044c\u044f \u0434\u043b\u044f \u0438\u0433\u0440\u043e\u043a\u0430 \u041e:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"\">\n<div><figcaption>\u0420\u0438\u0441.5. \u0414\u043b\u044f \u0438\u0433\u0440\u043e\u043a\u0430 \u041e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043e\u0440\u043e\u043d\u0430 \u0432 \u0436\u0435\u043b\u0442\u0443\u044e \u043a\u043b\u0435\u0442\u043a\u0443, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 mov_map[8]=-1 (\u0438\u043d\u0430\u0447\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0445\u043e\u0434 \u0425 \u0441\u044e\u0434\u0430 \u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0435\u0433\u043e \u043f\u043e\u0431\u0435\u0434\u0435).<\/figcaption><\/div>\n<\/figure>\n<ol start=\"3\">\n<li>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0435\u0441\u043b\u0438 \u0432 \u043e\u0434\u043d\u0443 \u043a\u043b\u0435\u0442\u043a\u0443 \u0441\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0434\u0432\u0435 \u043f\u043e\u0431\u0435\u0434\u043d\u044b\u0435 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0438\u0433\u0440\u043e\u043a\u0430 \u0425, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0445\u043e\u0434 \u0438\u0433\u0440\u043e\u043a\u0430 \u041e (<strong>\u0425\u041e=1<\/strong>):<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0438\u0441.6. \u0420\u0435\u0434\u043a\u043e\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435, \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 mov_map[8]=-2. <\/figcaption><\/div>\n<\/figure>\n<ol start=\"4\">\n<li>\n<p>\u041a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043e\u0434\u043d\u0443 \u043a\u043b\u0435\u0442\u043a\u0443 \u0441\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438 \u043f\u043e\u0431\u0435\u0434\u0430 \u0425 \u0438 \u043f\u043e\u0431\u0435\u0434\u0430 \u041e. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043d\u043e\u043b\u044c \u043f\u043e\u0441\u043b\u0435 \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f -1 \u0438 1 \u043b\u0443\u0447\u0448\u0435 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0430 \u0437\u0430\u0442\u0435\u043c \u0443\u043c\u043d\u043e\u0436\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u0438\u0445 \u0437\u043d\u0430\u043a\u0438 (\u043f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0445\u043e\u0442\u044c \u043e\u0434\u0438\u043d \u043c\u0438\u043d\u0443\u0441, \u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u0442\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0432\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u0438 \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u044b \u0432 \u043b\u043e\u0433\u0438\u043a\u0435).<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">def check_moves(): # finding the best cell for the next computer's move     global TTT, move     mov_map = [0, 0, 0, 0, 0, 0, 0, 0, 0] # map of the moves before each computer's move in current situation     move = None     # check for winning rows     # the sum of the moduli of the current value and the winning cell of the checked player, and then multiply them by the sign of the checked player     # in the most cases: zero + 1 or -1 (current player), but if the cell has two or three winners simultaneously, the module of the value must be 2 or 3 (-2 or -3)     for row in range(0, 7, 3):  # jump through 1 in TTT list         r=TTT[row] + TTT[row + 1] + TTT[row + 2]         if abs(r) == 2:             if TTT[row] == 0:                 mov = row                 mov_map[mov] = (abs(mov_map[mov])+abs(int((r) \/ 2)))*int((r) \/ 2) #the sum of winning's module both of players &amp; multiple on the current player's sign             elif TTT[row +<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-350375","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/350375","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=350375"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/350375\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=350375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=350375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=350375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}