{"id":299645,"date":"2020-03-04T09:00:23","date_gmt":"2020-03-04T09:00:23","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=299645"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=299645","title":{"rendered":"Julia \u0438 \u043a\u043b\u0435\u0442\u043e\u0447\u043d\u044b\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u044b"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/490454\/\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/te\/am\/jn\/teamjnrjsy-umukoljsjepmffk4.png\"><\/p>\n<p>  <\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c\u0441\u044f \u0432 \u043a\u0440\u0430\u0441\u043e\u0447\u043d\u043e\u0435 \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u0435 \u043f\u043e \u043c\u0438\u0440\u0443 \u043a\u043b\u0435\u0442\u043e\u0447\u043d\u044b\u0445 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u0432, \u043f\u043e\u043f\u0443\u0442\u043d\u043e \u0438\u0437\u0443\u0447\u0430\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u0438\u0442\u0440\u044b\u0435 \u043f\u0440\u0438\u0435\u043c\u044b \u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u044d\u0442\u043e\u0439 \u043a\u0440\u0430\u0441\u043e\u0442\u043e\u0439 \u2014 \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u0430\u044f \u0438\u0433\u0440\u0430 \u0434\u043b\u044f \u043f\u0440\u0430\u0437\u0434\u043d\u043e\u0433\u043e \u0443\u043c\u0430 \u0438\u043b\u0438 \u0433\u043b\u0443\u0431\u043e\u043a\u0430\u044f \u0444\u0438\u043b\u043e\u0441\u043e\u0444\u0441\u043a\u0430\u044f \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0430\u044f \u043e\u0442\u043a\u043b\u0438\u043a\u0438 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438 \u0438 \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0441\u0430\u043c\u043e\u043c\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u043d\u0438\u0436\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b. \u041d\u0443 \u0430 \u0435\u0441\u043b\u0438 \u043b\u0435\u043d\u044c, \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f\u043c\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"http:\/\/golly.sourceforge.net\" rel=\"nofollow\">Golly<\/a> \u2014 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0430\u044f \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u0435\u0442\u043e\u0447\u043d\u044b\u0445 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u0432 \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438 \u0438 \u0441\u0435\u0442\u043a\u0430\u043c\u0438. \u0412 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442\u0435 \u0435\u0441\u0442\u044c \u0431\u0430\u0437\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0438 \u043f\u0440\u0435\u0434\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u043a.<\/li>\n<li><a href=\"https:\/\/github.com\/Chakazul\/Lenia\" rel=\"nofollow\">Lenia<\/a> \u2014 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 &quot;\u0436\u0438\u0437\u043d\u0438&quot;.<\/li>\n<li><a href=\"http:\/\/lpcs.math.msu.su\/~zolin\/ant\/\" rel=\"nofollow\">\u041e\u043d\u043b\u0430\u0439\u043d \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440<\/a> \u0434\u043b\u044f \u043c\u0443\u0440\u0430\u0432\u044c\u044f \u041b\u044d\u043d\u0433\u0442\u043e\u043d\u0430. \u041e\u0441\u043e\u0431\u043e \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u0430 \u0442\u0440\u0438\u0430\u043d\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0439 \u0441\u0435\u0442\u043a\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u0435\u0434\u0443\u0442 \u0441\u0435\u0431\u044f \u043a\u0430\u043a \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u0438\u043a\u0441\u0435\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439<\/li>\n<\/ul>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gh\/ae\/ve\/ghaevesccwtayeaqj_q6aj5pvmo.png\"><\/p>\n<p>  <\/p>\n<h2 id=\"odnomernyy-sluchay\">\u041e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439<\/h2>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043a\u043b\u0435\u0442\u043e\u0447\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441 \u0441\u043e\u0431\u043e\u0439 \u043e\u0442\u0440\u0435\u0437\u043e\u043a \u0440\u0430\u0437\u0431\u0438\u0442\u044b\u0439 \u043d\u0430 \u0440\u0430\u0432\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u2014 \u044f\u0447\u0435\u0439\u043a\u0438. \u041a\u0430\u0436\u0434\u0430\u044f \u044f\u0447\u0435\u0439\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0438\u0437 \u0434\u0432\u0443\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439, \u0443\u0441\u043b\u043e\u0432\u043d\u043e 0 \u0438\u043b\u0438 1, \u0447\u0435\u0440\u043d\u044b\u0439 \u0438\u043b\u0438 \u0431\u0435\u043b\u044b\u0439, \u0436\u0438\u0432\u043e\u0439 \u0438\u043b\u0438 \u043c\u0435\u0440\u0442\u0432\u044b\u0439 \u0438 \u0442. \u0434. \u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0438 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u0430\u0432\u0438\u043b\u0443, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0449\u0435\u043c\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u043e\u0441\u0435\u0434\u0435\u0439. \u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0432\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0445 \u0441\u043e\u0441\u0435\u0434\u0435\u0439, \u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044e \u0438\u0437 \u0432\u043e\u0441\u044c\u043c\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0438\u0441\u043a\u043e\u043c\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0438 \u0438 \u043f\u0430\u0440\u044b \u0441\u043e\u0441\u0435\u0434\u0435\u0439. \u041a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u044d\u0442\u0438\u0445 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043e\u0434\u043d\u043e \u043d\u043e\u0432\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043b\u044f \u0438\u0441\u043a\u043e\u043c\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0438, \u0438\u0437 \u0447\u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0430\u0432\u0438\u043b \u0440\u0430\u0432\u043d\u043e\u0435 256 (\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e 8-\u0431\u0438\u0442\u043d\u044b\u0445 \u0441\u043b\u043e\u0432).<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dl\/x9\/kp\/dlx9kp-outr6lvq05tnzu6nffim.gif\"><\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0434\u0435\u0436\u043d\u043e \u0437\u0430\u043a\u0440\u0435\u043f\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0437 \u0432 \u0441\u0432\u043e\u0435\u0439 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0443\u044e \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0435 \u043a\u043b\u0435\u0442\u043e\u0447\u043d\u044b\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u044b.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"julia\">using Pkg pkgs = [&quot;Images&quot;, &quot;ColorSchemes&quot;, &quot;FFTW&quot;]  for p in pkgs     Pkg.add(p) end  using Images, ColorSchemes, FFTW, LinearAlgebra: kron using Random: bitrand cd(&quot;C:\\\\Users\\\\User\\\\Desktop\\\\Mycop&quot;)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043a\u043b\u0435\u0442\u043e\u0447\u043d\u044b\u0445 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u0432 \u0432\u044b\u0440\u0430\u0436\u0430\u044e\u0442 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u043e\u0442 0 \u0434\u043e 255 (\u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u043e\u0441\u044c\u043c\u0438\u0431\u0438\u0442\u043d\u044b\u0445 \u0441\u043b\u043e\u0432). \u0417\u043d\u0430\u0447\u0438\u0442 \u043d\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0443\u043c\u0435\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u043c\u0435\u0440 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u043c \u0432\u0438\u0434\u0435, \u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d. \u0417\u0430\u0442\u0435\u043c, \u043f\u0440\u0438 \u043d\u0430\u0438\u0432\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0445\u043e\u0434 \u043f\u043e \u0432\u0441\u0435\u043c \u044f\u0447\u0435\u0439\u043a\u0430\u043c \u0441 \u0437\u0430\u043c\u0435\u043d\u043e\u0439 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"julia\"># \u0440\u0430\u0437\u043c\u0435\u0440\u044b, \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 function cellauto( n::Int64, m::Int64, rule::Int64, s::Int64 = 1 )      ptrn = digits(Bool, rule, base = 2, pad = 8)     bt = [ bitstring(i)[end-2:end] for i = 0:7 ]     d = Dict( bt[i] =&gt; ptrn[i] for i = 1:8 ) # \u0441\u043b\u043e\u0432\u0430\u0440\u044c      M = falses(n,m)     M[1,m \u00f7 2] = true     #M[1,:] .= bitrand(m)     for i = 1:n-1, j = 2:m-1         key = &quot;$(M[i, j-1]*1)$(M[i, j]*1)$(M[i, j+1]*1)&quot;         M[i+1,j] = d[key]     end     kron(M, ones(Int,s,s) ) # \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u041a\u0440\u043e\u043d\u0435\u043a\u0435\u0440\u0430 end  M0 = cellauto(100, 200, 30, 4) Gray.( M0 )<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gr\/fg\/-4\/grfg-4t74lqe7wjl3ingd3ubevc.png\"><\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e 30, \u043e\u0434\u043d\u043e \u0438\u0437 \u043b\u044e\u0431\u0438\u043c\u044b\u0445 \u0421\u0442\u0438\u0432\u0435\u043d\u0430 \u0412\u043e\u043b\u044c\u0444\u0440\u0430\u043c\u0430. \u041e\u043d, \u043a\u0441\u0442\u0430\u0442\u0438, \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u043b \u0434\u0435\u043d\u0435\u0436\u043d\u044b\u0435 \u043f\u0440\u0438\u0437\u044b \u0437\u0430 <a href=\"https:\/\/habr.com\/ru\/company\/wolfram\/blog\/470425\/\">\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447<\/a> \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u044d\u0442\u0438\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u043e\u043c. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432 \u044d\u0442\u043e\u043c \u0447\u0442\u043e-\u0442\u043e \u0435\u0441\u0442\u044c: \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u0433\u0440\u0430\u043d\u0438\u0447\u0430\u0449\u0430\u044f \u0441 \u0445\u0430\u043e\u0441\u043e\u043c, \u043f\u043b\u044e\u0441 \u0441\u043f\u043e\u043d\u0442\u0430\u043d\u043d\u043e\u0435 \u0437\u0430\u0440\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u2026 \u041d\u043e \u043b\u0438\u0447\u043d\u043e \u043c\u0435\u043d\u044f \u0437\u0430\u0446\u0435\u043f\u0438\u043b\u0438 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0438 \u0421\u0435\u0440\u043f\u0438\u043d\u0441\u043a\u043e\u0433\u043e, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f <a href=\"https:\/\/habr.com\/ru\/post\/471908\/#comment_20786518\">\u0437\u0434\u0435\u0441\u044c \u0438 \u0442\u0430\u043c<\/a>. \u0410 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u041a\u0410 \u043e\u043d\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e\u0435 \u044f\u0432\u043b\u0435\u043d\u0438\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"julia\">Arr = cellauto.(40, 40, [0:23;], 2); Imgs = [ Gray.(a) for a in Arr ] reshape(Imgs, 4,6)<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xj\/9w\/dm\/xj9wdmaxvdgvz3pqc3iyncq6uws.png\"><\/p>\n<p>  <\/p>\n<h3 id=\"v-krugah-i-v-cvete\">\u0412 \u043a\u0440\u0443\u0433\u0430\u0445 \u0438 \u0432 \u0446\u0432\u0435\u0442\u0435<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0440\u0436\u0435\u043d\u0446\u0430\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c <a href=\"https:\/\/github.com\/YermolenkoIgor\/Julia_tutorial_rus\/blob\/master\/Toyz\/automata.ipynb\" rel=\"nofollow\">\u0432\u0430\u0440\u0438\u0430\u043d\u0442<\/a>, \u0433\u0434\u0435 \u043a\u043b\u0435\u0442\u043e\u0447\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0440\u044c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0446\u0432\u0435\u0442\u0430 \u0438 \u0434\u0430\u0436\u0435 \u043a\u0440\u0443\u0433\u043b\u044b\u0435 \u043f\u043e\u043b\u044f:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ng\/ru\/al\/ngrualxkvbrdugbgtugmdttv9za.png\"><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fe\/jn\/2b\/fejn2bm8o_kgxxewjv4lplpzlxu.png\"><\/p>\n<p>  <\/p>\n<p>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u043a\u0435\u0442\u0430 Luxor, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b <a href=\"https:\/\/habr.com\/ru\/post\/459842\/\">\u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0438 \u0440\u0430\u043d\u0435\u0435<\/a>.<\/p>\n<p>  <\/p>\n<h2 id=\"igra-v-zhizn\">\u0418\u0433\u0440\u0430 \u0432 \u0436\u0438\u0437\u043d\u044c<\/h2>\n<p>  <\/p>\n<p>&quot;\u0416\u0438\u0437\u043d\u044c&quot; \u041a\u043e\u043d\u0432\u0435\u044f \u2014 \u0441\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0438\u0437 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0445 (\u0434\u0430 \u0438 \u0442\u0440\u0435\u0445\u043c\u0435\u0440\u043d\u044b\u0445) \u043a\u043b\u0435\u0442\u043e\u0447\u043d\u044b\u0445 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u0432. \u042d\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0442\u0434\u0430\u043b\u0435\u043d\u043d\u043e \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u043a\u043e\u043f\u043e\u0448\u0435\u043d\u0438\u0435 \u0431\u0430\u043a\u0442\u0435\u0440\u0438\u0439 \u0432 \u0447\u0430\u0448\u043a\u0435 \u041f\u0435\u0442\u0440\u0438, \u0438 \u043e\u0431\u043b\u0430\u0434\u0430\u044f \u0422\u044c\u044e\u0440\u0438\u043d\u0433 \u043f\u043e\u043b\u043d\u043e\u0442\u043e\u0439, \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043e\u0439 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u0443\u0433\u043e\u0434\u043d\u043e: <a href=\"https:\/\/habr.com\/ru\/post\/308370\/\">\u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u044b\u0448\u043b\u0435\u043d\u0438\u044f<\/a>, \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u0432 (<a href=\"https:\/\/habr.com\/ru\/post\/338584\/\">\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0442\u0435\u0442\u0440\u0438\u0441\u0430<\/a>) \u0438 <a href=\"https:\/\/www.youtube.com\/watch?time_continue=3&amp;v=xP5-iIeKXE8&amp;feature=emb_logo\" rel=\"nofollow\">\u0441\u0430\u043c\u043e\u0439 \u0441\u0435\u0431\u044f<\/a>.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/lr\/mr\/jq\/lrmrjqwj4ne2rt72--vgqkn6o-k.gif\"><br \/>  <em><a href=\"https:\/\/copy.sh\/life\/?gist=f3413564b1fa9c69f2bad4b0400b8090&amp;step=512\" rel=\"nofollow\">\u0438\u0433\u0440\u0430\u0431\u0435\u043b\u044c\u043d\u043e<\/a><\/em><\/p>\n<p>  <\/p>\n<p>\u041c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u044d\u043d\u0442\u0443\u0437\u0438\u0430\u0441\u0442\u043e\u0432 \u043d\u0430\u0445\u043e\u0434\u044f\u0442 <a href=\"https:\/\/www.youtube.com\/watch?feature=player_detailpage&amp;v=C2vgICfQawE\" rel=\"nofollow\">\u0432\u0441\u0435 \u043d\u043e\u0432\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b<\/a>: \u043e\u0441\u0446\u0438\u043b\u043b\u044f\u0442\u043e\u0440\u044b, \u0433\u043b\u0430\u0439\u0434\u0435\u0440\u044b, \u043a\u043e\u0440\u0430\u0431\u043b\u0438 (<a href=\"https:\/\/www.conwaylife.com\/wiki\/Caterpillar\" rel=\"nofollow\">\u043d\u0430 \u0433\u0443\u0441\u0435\u043d\u0438\u0447\u043d\u043e\u043c \u0445\u043e\u0434\u0443!<\/a>) \u0438 \u0444\u0430\u0431\u0440\u0438\u043a\u0438. \u0422\u043e \u0435\u0441\u0442\u044c, \u0432\u0441\u044f \u043f\u0440\u0435\u043b\u0435\u0441\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043f\u0440\u0430\u0432\u0438\u043b \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043e\u0442\u043a\u0443\u0434\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0441\u043e\u0431\u043b\u0430\u0437\u043d \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u043a\u043e\u043d\u044b \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0430. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0421. \u0412\u043e\u043b\u044c\u0444\u0440\u0430\u043c \u0431\u0430\u043b\u0443\u0435\u0442 \u043d\u0430\u0441 <a href=\"https:\/\/habr.com\/ru\/company\/wolfram\/blog\/303836\/\">\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c\u0438 \u0432\u044b\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043d\u0438\u044f\u043c\u0438<\/a>. \u0412\u043e\u043f\u0440\u043e\u0441, \u043d\u0430 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u043d\u043e \u0438, \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043f\u043e\u0440\u044b, \u0442\u0430\u043a \u0447\u0442\u043e, \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043d\u0430 \u043d\u0435\u043c \u0437\u0430\u043e\u0441\u0442\u0440\u044f\u0442\u044c\u0441\u044f. \u041b\u0443\u0447\u0448\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c &quot;\u0416\u0438\u0437\u043d\u044c&quot; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0443\u044e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0424\u0443\u0440\u044c\u0435.<\/p>\n<p>  <\/p>\n<h3 id=\"zhizn-bez-fure-i-ne-zhizn-vovse\">\u0416\u0438\u0437\u043d\u044c \u0431\u0435\u0437 \u0424\u0443\u0440\u044c\u0435 \u0438 \u043d\u0435 \u0436\u0438\u0437\u043d\u044c \u0432\u043e\u0432\u0441\u0435<\/h3>\n<p>  <\/p>\n<p>\u0422\u0435\u043c, \u043a\u0442\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0441\u044f <a href=\"https:\/\/habr.com\/ru\/company\/yandex\/blog\/254249\/\">\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/a>, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%91%D1%8B%D1%81%D1%82%D1%80%D0%BE%D0%B5_%D0%BF%D1%80%D0%B5%D0%BE%D0%B1%D1%80%D0%B0%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5_%D0%A4%D1%83%D1%80%D1%8C%D0%B5\" rel=\"nofollow\">\u0411\u041f\u0424<\/a> \u0432 \u0442\u0430\u043a\u043e\u043c \u0430\u0441\u043f\u0435\u043a\u0442\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0437\u043d\u0430\u043a\u043e\u043c\u0430. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043e\u0432\u0435\u0442\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0438 \u0441\u043d\u0430\u0431\u0434\u0438\u0442 \u0432\u0430\u0441 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f\u043c\u0438 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0430\u043b\u0433\u0435\u0431\u0440\u044b.<\/p>\n<p>  <\/p>\n<p>\u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0438\u0437 <a href=\"https:\/\/habr.com\/ru\/post\/180135\/\">\u0445\u0430\u0431\u0440\u043e\u0432\u0441\u043a\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438<\/a><\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"julia\">function makefilter(N::Int64)     filter = zeros(Complex, N, N);     IDX(x, y) = ( (x + N) % N ) + ( (y+N) % N ) * N + 1         filter[IDX(-1, -1)] = 1. ;         filter[IDX( 0, -1)] = 1. ;         filter[IDX( 1, -1)] = 1. ;         filter[IDX(-1,  0)] = 1. ;         filter[IDX( 1,  0)] = 1. ;         filter[IDX(-1,  1)] = 1. ;         filter[IDX( 0,  1)] = 1. ;         filter[IDX( 1,  1)] = 1. ;      return fft( real.(filter) ) end  function fftlife(N = 16, steps = 100, dx = 0, glider = true)      if glider         state = falses(N, N)         state[4,5] = state[5,6] = state[6,6] = true         state[6,5] = state[6,4] = true     else         state = bitrand(N, N)     end      filter = makefilter(N)      for i in 1:steps         tmp = fft( real.(state) ) # forward         tmp .*= filter          summ = ifft(tmp) # reverse          for i in eachindex(state)             t = round( Int, real(summ[i]) ) &gt;&gt; dx             state[i] = ( state[i] ? t == 2 || t == 3 : t == 3 )         end         save(&quot;KonLife_$(N)x$(N)_$i.png&quot;, kron( Gray.(state), ones(8,8) ) )     end  end  fftlife(16, 60)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ke\/sb\/53\/kesb53gdy-c_ve9tvi9h9o_uqce.gif\"><\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u044f\u0442\u043d\u044b\u0435 \u0431\u043e\u043d\u0443\u0441\u044b \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u2014 \u044d\u0442\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0430\u044f \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0411\u041f\u0424 \u0432 \u0441\u0438\u043b\u0443 \u0435\u0433\u043e \u043e\u0442\u043f\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u0438, \u0438 \u0437\u0430\u043a\u043e\u043b\u044c\u0446\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 (\u0434\u0435\u0439\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043a\u0430\u043a \u0431\u044b \u043d\u0430 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u0438 \u0442\u043e\u0440\u0430). \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0431\u0449\u0438\u0442\u044c &quot;\u0436\u0438\u0437\u043d\u044c&quot; \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u044b\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u043c.<\/p>\n<p>  <\/p>\n<h3 id=\"gladkaya-zhizn\">\u0413\u043b\u0430\u0434\u043a\u0430\u044f \u0436\u0438\u0437\u043d\u044c<\/h3>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/duckythescientist\/SmoothLife\" rel=\"nofollow\">\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a><\/li>\n<li><a href=\"https:\/\/0fps.net\/2012\/11\/19\/conways-game-of-life-for-curved-surfaces-part-1\/\" rel=\"nofollow\">\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435<\/a><\/li>\n<li><a href=\"https:\/\/www.csun.edu\/~kme52026\/thesis.html\" rel=\"nofollow\">\u0414\u0438\u0441\u0435\u0440 \u0441 \u0434\u043e\u0441\u043a\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a \u0432 \u043e\u0431\u0449\u0435\u043c \u0432\u0438\u0434\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043c\u043e\u0434\u0435\u043b\u044c:<\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6f7\/00a\/c1e\/6f700ac1ea30fc64b18b595bc90a25f6.svg\" alt=\"$ \\frac{df(x,t)}{dt} = S\\left(N(x,t),M(x,t) \\right ) - f(x,t) \\\\ \\\\ S(n,m) = \\sigma_n\\left(\\sigma_m(b_1, b_2), \\sigma_m(d_1,d_2)\\right)\\\\ M(x,t) = \\frac{1}{\\pi h^2} \\int\\limits_{0\\le |y| \\le h} f(x-y, t) dy \\\\ N(x,t) = \\frac{1}{8\\pi h^2} \\int\\limits_{0\\le |y| \\le 3h} f(x-y, t) dy $\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435 1 \u0438 0, \u0430 \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u043e\u0439, \u0441\u043e\u0441\u0435\u0434\u0438 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0434\u0438\u0443\u0441\u0435, \u0430 \u0435\u0449\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0440\u0435\u0448\u0430\u0442\u044c \u0434\u0438\u0444\u0443\u0440\u044b.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"julia\">function clamp(x)     y = copy(x)     y[x.&gt;1] .= 1     y[x.&lt;0] .= 0     y end  function func_linear(X, a, b)     Y = [ (x-a + 0.5b)\/b for x in X ]      Y[X.&lt;a-0.5b] .= 0     Y[X.&gt;a+0.5b] .= 1     return Y end  function splat!(aa, ny, nx, ra)     x = round(Int, rand()*nx ) + 1     y = round(Int, rand()*ny ) + 1     c = rand() &gt; 0.5      for dx = -ra:ra, dy = -ra:ra         ix = x+dx         iy = y+dy         if ix&gt;=1 &amp;&amp; ix&lt;=nx &amp;&amp; iy&gt;=1 &amp;&amp; iy&lt;=ny             aa[iy,ix] = c         end     end end  function initaa(ny, nx, ra)     aa = zeros(ny, nx)     for t in 0:((nx\/ra)*(ny\/ra))         splat!(aa, ny, nx, ra);     end     aa end<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u0438\u0433\u043c\u043e\u0438\u0434\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"julia\">func_smooth(x::Float64, a, b)  = 1 \/ ( 1 + exp(-4(x-a)\/b) )   sigmoid_a(x, a, ea) = func_smooth(x, a, ea) sigmoid_b(x, b, eb) = 1 - sigmoid_a(x, b, eb) sigmoid_ab(x, a, b, ea, eb) = sigmoid_a(x, a, ea) * sigmoid_b(x, b, eb) sigmoid_mix(x, y, m, em) = x - x * func_smooth(m, 0.5, em) + y * func_smooth(m, 0.5, em)  function snm(N, M, en, em, b1, b2, d1, d2)      [ sigmoid_mix( sigmoid_ab(N[i,j], b1, b2, en, en),                     sigmoid_ab(N[i,j], d1, d2, en, en), M[i,j], em )                      for i = 1:size(N, 1), j = 1:size(N, 2) ] end<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"julia\">function smoothlife(NX = 128, NY = 128, tfin = 10, scheme = 1)      function derivative(aa)         aaf = fft(aa)         nf = aaf .* krf         mf = aaf .* kdf         n = real.(ifft(nf)) \/ kflr # irfft         m = real.(ifft(mf)) \/ kfld         2snm(n, m, alphan, alpham, b1, b2, d1, d2) .- 1     end      ra = 10     ri = ra\/3     b = 1     b1 = 0.257     b2 = 0.336     d1 = 0.365     d2 = 0.551     alphan = 0.028     alpham = 0.147      kd = zeros(NY,NX)     kr = zeros(NY,NX)     aa = zeros(NY,NX)      x = [ j - 1 - NX\/2 for i=1:NY, j=1:NX ]     y = [ i - 1 - NY\/2 for i=1:NY, j=1:NX ]      r = sqrt.(x.^2 + y.^2)     kd = 1 .- func_linear(r, ri, b) # ones(NY, NX)     kr = func_linear(r, ri, b) .* ( 1 .- func_linear(r, ra, b) )     #aa = snm (ix\/NX, iy\/NY, alphan, alpham, b1, b2, d1, d2);     kflr = sum(kr)     kfld = sum(kd)     krf = fft(fftshift(kr))     kdf = fft(fftshift(kd))      #for td in 2 .^(10:-1:3)     for td = 64          aa = initaa(NY,NX,ra)         dt = 1\/td;         l = 0         nx = 0         for t = 0:dt:tfin # 1=euler  2=improved euler  3=adams bashforth 3  4=runge kutta 4             if scheme==1                  aa += dt*derivative(aa)              elseif scheme==2                  da = derivative(aa);                 aa1 = clamp(aa + dt*da)                 for h = 0:20                     alt = aa1                     aa1 = clamp(aa + dt*(da + derivative(aa1))\/2)                     if maximum(abs.(alt-aa1))&lt;1e-8                          break                     end                 end                 aa = copy(aa1)              elseif scheme==3                  n0 = 1+mod(l,3)                 n1 = 1+mod(l-1,3)                 n2 = 1+mod(l-2,3)                  f = zeros(NY, NX, 3) # ?                 f[:,:,n0] = derivative(aa)                 if l==0                     aa += dt*f[:,:,n0]                 elseif l==1                     aa += dt*(3*f[:,:,n0] - f[:,:,n1])\/2                 elseif l&gt;=2                     aa += dt*(23*f[:,:,n0] - 16*f[:,:,n1] + 5*f[:,:,n2])\/12                 end              elseif scheme==4                  k1 = derivative(aa)                 k2 = derivative(clamp(aa + dt\/2*k1))                 k3 = derivative(clamp(aa + dt\/2*k2))                 k4 = derivative(clamp(aa + dt*k3))                 aa += dt*(k1 + 2*k2 + 2*k3 + k4)\/6              end              aa = clamp(aa)              if t &gt;= nx                 save(&quot;$(scheme)\\\\$(td)_$t.png&quot;, Gray.(kron(aa, ones(2, 2) ) ) )                 nx += 1;             end              l += 1;         end      end     # for td end  @time smoothlife(256, 256, 20, 3)<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/y6\/ve\/ol\/y6veolr14pmra6qkmhg2ntjobd8.gif\"><\/p>\n<p>  <\/p>\n<p>\u0412 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u0434\u043b\u044f \u0434\u0438\u0444\u0443\u0440\u043e\u0432. \u0412 \u043e\u0431\u0449\u0435\u043c, \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0440 \u0434\u043b\u044f \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0439. \u0422\u0430\u043a\u0436\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0440\u0430\u0441\u0438\u0442\u044c \u0448\u0435\u0439\u0434\u0435\u0440\u0430\u043c\u0438.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/lp\/yj\/yn\/lpyjynzsj-7mo_flncaimu3h7rc.png\"><\/p>\n<p>  <\/p>\n<h2 id=\"tyurmity\">\u0422\u044c\u044e\u0440\u043c\u0438\u0442\u044b<\/h2>\n<p>  <\/p>\n<p>\u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0432\u0438\u0434 \u043c\u0430\u0448\u0438\u043d \u0422\u044c\u044e\u0440\u0438\u043d\u0433\u0430 \u044d\u0442\u043e <a href=\"https:\/\/en.wikipedia.org\/wiki\/Turmite\" rel=\"nofollow\">\u0442\u044c\u044e\u0440\u043c\u0438\u0442\u044b<\/a> \u2014 \u043a\u043b\u0435\u0442\u043e\u0447\u043d\u044b\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u044b, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043a\u0438\u043c \u0430\u0433\u0435\u043d\u0442\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043f\u043e\u043b\u044e \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u044d\u0442\u0438\u0445 \u0441\u0430\u043c\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043b\u044c \u044d\u0442\u043e\u0433\u043e \u0432\u0438\u0434\u0430 \u2014 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9C%D1%83%D1%80%D0%B0%D0%B2%D0%B5%D0%B9_%D0%9B%D1%8D%D0%BD%D0%B3%D1%82%D0%BE%D0%BD%D0%B0\" rel=\"nofollow\">\u043c\u0443\u0440\u0430\u0432\u0435\u0439 \u041b\u044d\u043d\u0433\u0442\u043e\u043d\u0430<\/a>. <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yr\/tt\/sp\/yrttspeh1ykrudvpwoqev6yrrsk.gif\"><\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u043a\u043b\u0435\u0442\u043e\u0447\u043d\u043e\u0435 \u043f\u043e\u043b\u0435, \u043a\u0430\u0436\u0434\u0430\u044f \u044f\u0447\u0435\u0439\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u0438\u0431\u043e \u0447\u0435\u0440\u043d\u043e\u0439 \u043b\u0438\u0431\u043e \u0431\u0435\u043b\u043e\u0439, \u0441\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u043c\u0443\u0440\u0430\u0448, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041d\u0430 \u0447\u0451\u0440\u043d\u043e\u043c \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0435 \u2014 \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1f7\/311\/bbe\/1f7311bbeecd1aa665d6babf72501a8c.svg\" alt=\"$90^\\circ$\" data-tex=\"inline\"><\/math> \u0432\u043b\u0435\u0432\u043e, \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0446\u0432\u0435\u0442 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \u043d\u0430 \u0431\u0435\u043b\u044b\u0439, \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0448\u0430\u0433 \u0432\u043f\u0435\u0440\u0435\u0434 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043b\u0435\u0442\u043a\u0443.<\/li>\n<li>\u041d\u0430 \u0431\u0435\u043b\u043e\u043c \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0435 \u2014 \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1f7\/311\/bbe\/1f7311bbeecd1aa665d6babf72501a8c.svg\" alt=\"$90^\\circ$\" data-tex=\"inline\"><\/math> \u0432\u043f\u0440\u0430\u0432\u043e, \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0446\u0432\u0435\u0442 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \u043d\u0430 \u0447\u0451\u0440\u043d\u044b\u0439, \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0448\u0430\u0433 \u0432\u043f\u0435\u0440\u0435\u0434 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043b\u0435\u0442\u043a\u0443.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041d\u0430 rosetta code \u0435\u0441\u0442\u044c <a href=\"http:\/\/rosettacode.org\/wiki\/Langton%27s_ant\" rel=\"nofollow\">\u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0445\u0438\u0442\u0440\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/a>, \u0433\u0434\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u0443\u0440\u0430\u0432\u044c\u044f \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"julia\">function ant(width, height)     y, x = fld(height, 2), fld(width, 2)     M = trues(height, width)      dir = im     for i in 0:1000000         x in 1:width &amp;&amp; y in 1:height || break         dir *= M[y, x] ? im : -im         M[y, x] = !M[y, x]         x, y = reim(x + im * y + dir)         i%100==0 &amp;&amp; save(&quot;LR\/\/zLR_$i.png&quot;, Gray.( kron(M,ones(4,4) ) ) )     end      Gray.(M) end  ant(100, 100)<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/p_\/rt\/b2\/p_rtb2uiqvman80izhhh8v7j7eo.gif\"><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043d\u0430\u0447\u0430\u043b\u0443, \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0430\u0433\u0435\u043d\u0442\u0430 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0445\u0430\u043e\u0442\u0438\u0447\u043d\u044b\u043c. \u041d\u043e \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0430\u0433\u0438\u0441\u0442\u0440\u0430\u043b\u044c \u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0441\u0442\u0430\u0446\u0438\u043e\u043d\u0430\u0440. \u041f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u0435\u0439\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u0438\u0437 \u043a\u0430\u0436\u0438\u043c\u043e\u0433\u043e \u0445\u0430\u043e\u0441\u0430!<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0441\u0430\u043c\u044b\u0439 \u0441\u043c\u0430\u043a \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0435\u0441\u043b\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u044f\u0447\u0435\u0439\u043a\u0438 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u0431\u0438\u0442\u0430:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"julia\">function ant(width, height, comnds;         steps = 10, cxema = reverse(ColorSchemes.hot),          savevery = 100, pixfactor = 20)      ma3x2pix() = [ clrs[k%n+1] for k in M ]       bigpix() = kron( ma3x2pix(), ones(Int64,m,m) )     save2pix(i) = save(&quot;$(comnds)_$i.png&quot;, bigpix() )      m = pixfactor     n = length(comnds)     colorsinscheme = length(cxema)     M = zeros(Int64, height, width)     y, x = fld(height, 2), fld(width, 2)      st = colorsinscheme \u00f7 n     clrs = [ cxema.colors[i] for i in 1:st:colorsinscheme ]      dir = im     for i in 0:steps         x in 1:width &amp;&amp; y in 1:height || (save2pix(i); break)         j = M[y, x] % n + 1         dir *= comnds[j] == 'L' ? -im : im         M[y, x] += 1         x, y = reim(x + im * y + dir)          i % savevery==0 &amp;&amp; save2pix(i)     end     ma3x2pix() end  @time ant(16, 16, &quot;LLRR&quot;, steps = 100, savevery = 1, pixfactor = 20)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/et\/6h\/jn\/et6hjnqf3m29aykxeobexdpn1zu.gif\"><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u043e\u0439\u043d\u044b\u043c\u0438 \u043d\u0430\u0440\u0430\u0449\u0438\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u043f\u043e\u0445\u043e\u0436\u0443\u044e \u043d\u0430 \u043c\u043e\u0437\u0433! \u0414\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0446\u0432\u0435\u0442\u043e\u0432\u044b\u0445 \u0441\u0445\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0444\u0443\u0442\u0443\u0440\u0438\u0441\u0442\u0438\u0447\u043d\u043e<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rg\/0x\/yx\/rg0xyxvt9xhuuuaoasn8qkazcqo.png\"><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nt\/de\/_o\/ntde_oisuiixl1twfhr8x97zpty.png\" title=\"LLRR\"><\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0430\u0432\u0434\u0430 \u043f\u043e\u0442\u043e\u043c \u043e\u043d \u0432\u044b\u0440\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0432 <del>\u0436\u043e\u043f\u0443<\/del> <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9A%D0%B0%D1%80%D0%B4%D0%B8%D0%BE%D0%B8%D0%B4%D0%B0\" rel=\"nofollow\">\u043a\u0430\u0440\u0434\u0438\u043e\u0438\u0434\u0443<\/a>. \u041a\u0441\u0442\u0430\u0442\u0438, \u043d\u0438\u0447\u0435\u0433\u043e \u0435\u0449\u0435 \u043d\u0435 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442? \u0410 \u0435\u0441\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0440\u0430\u043a\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043d\u0430\u0440\u043e\u0441\u0442\u043e\u0432?..<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"julia\"># http:\/\/rosettacode.org\/wiki\/Mandelbrot_set function hsv2rgb(h, s, v)     c = v * s     x = c * (1 - abs(((h\/60) % 2) - 1) )     m = v - c      r,g,b =         if h &lt; 60             (c, x, 0)         elseif h &lt; 120             (x, c, 0)         elseif h &lt; 180             (0, c, x)         elseif h &lt; 240             (0, x, c)         elseif h &lt; 300             (x, 0, c)         else             (c, 0, x)         end      (r + m), (b + m), (g + m) end  function mandelbrot()      w, h = 1000, 1000      zoom  = 1.0     moveX = 0     moveY = 0      img = Array{RGB{Float64}, 2}(undef,h, w)     maxIter = 30      for x in 1:w         for y in 1:h             i = maxIter             c = Complex(                 (2*x - w) \/ (w * zoom) + moveX,                 (2*y - h) \/ (h * zoom) + moveY             )             z = c             while abs(z) &lt; 2 &amp;&amp; (i -= 1) &gt; 0                 z = z^2 + c             end             r,g,b = hsv2rgb(i \/ maxIter * 360, 1, i \/ maxIter)             img[y,x] = RGB{Float64}(r, g, b)         end     end      save(&quot;mandelbrot_set2.png&quot;, img) end  mandelbrot()<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/o5\/st\/aw\/o5stawfnqjqf-r4zpmjmrsqmy6c.png\"><\/p>\n<p>  <\/p>\n<p>\u0438 \u0435\u0449\u0435 \u0440\u044f\u0434 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u0438\u043b:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bs\/no\/_r\/bsno_rewy0dfkweszbx3xabsxps.gif\" title=\"RRRLRRLRRR\"><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/uo\/wr\/_t\/uowr_tzhcvqmjnwj7hhmsuxgiau.png\" title=\"RRRLR9000000\"><\/p>\n<p>  <\/p>\n<p>\u041c\u0430\u0433\u0438\u0441\u0442\u0440\u0430\u043b\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e\u0435 \u044f\u0432\u043b\u0435\u043d\u0438\u0435<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ay\/jf\/aw\/ayjfawjzlx8nimlymcpqftfykrq.png\" title=\"RRLRLLRRRRLL\"><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/1d\/hk\/jv\/1dhkjvggxwrlocttcby8k_v0cy4.png\" title=\"RRLR\"><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ex\/w3\/cw\/exw3cwl-4myadqggc_jaavcbzvw.gif\" title=\"RRLLLRLRL\"><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/8e\/ww\/z1\/8ewwz1qic3bzjhfjikgahfdx2ay.gif\" title=\"RRLLLRLLLRLL\"><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ig\/dr\/8m\/igdr8mjhbkul6_w-0eshjq404ec.png\" title=\"RRLLLRLLLLL_200000000\"><\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0437\u0433 \u0432 \u044f\u0449\u0438\u043a\u0435 \u2014 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430. \u0417\u0434\u0435\u0441\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0442\u0440\u0438\u0434\u0446\u0430\u0442\u0438 \u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u043e\u0432 \u0448\u0430\u0433\u043e\u0432:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/iw\/s5\/zi\/iws5zizcf0ivtoir7xjkz3mbryk.png\" title=\"RRLLLL30_000_000_000\"><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pn\/t-\/_4\/pnt-_4onnrt7tegrrnlfu7qr3u0.gif\" title=\"RLLR\"><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2i\/tr\/10\/2itr10tcx17jwv_3wxb01snicko.gif\" title=\"RLLLLRRRLLL\"><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ey\/lu\/8b\/eylu8bwkpa0df819caufdoncd-a.gif\" title=\"RLLLLLLLRRL\"><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_p\/bx\/dz\/_pbxdzqv8psp9o6wzomp48rf_-u.gif\" title=\"LLRLLLL\"><\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0440\u043e\u0447\u0435, \u0441 \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0441\u0435\u0441\u0442\u044c \u043d\u0430\u0434\u043e\u043b\u0433\u043e. \u0418 \u044d\u0442\u043e \u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0434\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f (\u043b\u0435\u0432\u043e-\u043f\u0440\u0430\u0432\u043e), \u0430 \u0432\u0435\u0434\u044c \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0449\u0435 \u0432\u043f\u0435\u0440\u0435\u0434-\u043d\u0430\u0437\u0430\u0434, \u043a \u0442\u043e\u043c\u0443 \u0436\u0435, \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b, \u0447\u0442\u043e \u043c\u0443\u0440\u0430\u0432\u0435\u0439 \u043e\u0431\u044f\u0437\u0430\u043d \u043f\u0440\u043e\u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0434\u043d\u0443 \u043a\u043b\u0435\u0442\u043a\u0443! \u0414\u0435\u0440\u0436\u0443 \u043f\u0430\u0440\u0438, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u0438\u043b \u043f\u043e\u0440\u043e\u0434\u0438\u0442 \u0435\u0449\u0435 \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0435\u0439!<\/p>\n<p>  <\/p>\n<h3 id=\"epilog\">\u042d\u043f\u0438\u043b\u043e\u0433<\/h3>\n<p>  <\/p>\n<p>\u041a \u0441\u043b\u043e\u0432\u0443 \u043e \u0436\u0438\u0437\u043d\u0438. \u041d\u0435\u043c\u0430\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u0441\u0430\u043c\u043e\u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u044f\u0449\u0438\u0435\u0441\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0430 \u043b\u044f <a href=\"https:\/\/en.wikipedia.org\/wiki\/Langton%27s_loops\" rel=\"nofollow\">\u0446\u0438\u043a\u043b\u044b \u041b\u044d\u043d\u0433\u0442\u043e\u043d\u0430<\/a><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qk\/4x\/-h\/qk4x-hswl62dg3lewaxqah9qzis.gif\"><\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/www.researchgate.net\/publication\/4249781_Sexyloop_Self-Reproduction_Evolution_and_Sex_in_Cellular_Automata\" rel=\"nofollow\">\u0441\u0442\u0430\u0442\u044c\u044e<\/a>, \u0433\u0434\u0435 \u0434\u0430\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435\u043c \u043f\u043e\u043b\u0430 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0433\u0435\u043d\u043e\u0432. <em>(\u0422\u0443\u0442 \u0443\u0436 \u043f\u0435\u0440\u0435\u0434\u0430\u044e \u044d\u0441\u0442\u0430\u0444\u0435\u0442\u0443 \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c \u0434\u0440\u0443\u0433\u043e\u043c\u0443. \u041e\u0447\u0435\u043d\u044c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u0448\u0442\u0443\u043a\u0438)<\/em><\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043c\u0430 \u043a\u043b\u0435\u0442\u043e\u0447\u043d\u044b\u0445 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u0432 \u0441 \u0440\u043e\u0441\u0442\u043e\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0441\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0435\u0439. \u0423 \u0412\u043e\u043b\u044c\u0444\u0440\u0430\u043c\u0430 \u0432 \u0431\u043b\u043e\u0433\u0435 <a href=\"https:\/\/writings.stephenwolfram.com\/2012\/05\/its-been-10-years-whats-happened-with-a-new-kind-of-science\/\" rel=\"nofollow\">\u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0442\u0447\u0435\u0442<\/a> \u043f\u043e \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435, \u0434\u0430 \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 <a href=\"https:\/\/arxiv.org\/search\/?query=&quot;cellular+automata&quot;&amp;searchtype=title&amp;abstracts=show&amp;order=-announced_date_first&amp;size=50\" rel=\"nofollow\">\u0441\u0430\u043c \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f<\/a> \u2014 \u0441\u0442\u0430\u0442\u0435\u0439 \u043c\u043d\u043e\u0433\u043e, \u043f\u0440\u0438\u0447\u0435\u043c \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445: \u0442\u0430\u043c \u0432\u0430\u043c \u0438 \u0434\u0440\u0443\u0436\u0431\u0430 \u0441 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u043c\u0438 \u0441\u0435\u0442\u044f\u043c\u0438, \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b, \u0438 \u043a\u0432\u0430\u043d\u0442\u043e\u0432\u044b\u0435 \u0442\u043e\u0447\u043a\u0438, \u0438 \u0441\u0436\u0430\u0442\u0438\u0435 \u0438 \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u044f\u043a\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e&#8230;<\/p>\n<p>  <\/p>\n<p>\u041d\u0443 \u0438 \u043d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a \u0441\u0430\u043c\u043e\u043a\u043e\u043f\u0438\u0440\u0443\u044e\u0449\u0430\u044f\u0441\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u0422\u044d\u0434\u043e\u043c \u041a\u043e\u0434\u0434\u043e\u043c <a href=\"https:\/\/timhutton.github.io\/2010\/03\/10\/30984.html\" rel=\"nofollow\">\u043d\u0430 \u0441\u043f\u043e\u0440 \u0437\u0430 \u043f\u0438\u043d\u0442\u0443 \u043f\u0438\u0432\u0430<\/a><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bd\/jj\/wv\/bdjjwvjyolkqdtpdr414jjnlgfg.gif\"><\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/490454\/\"> https:\/\/habr.com\/ru\/post\/490454\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/490454\/\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/te\/am\/jn\/teamjnrjsy-umukoljsjepmffk4.png\"><\/p>\n<p>  <\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c\u0441\u044f \u0432 \u043a\u0440\u0430\u0441\u043e\u0447\u043d\u043e\u0435 \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u0435 \u043f\u043e \u043c\u0438\u0440\u0443 \u043a\u043b\u0435\u0442\u043e\u0447\u043d\u044b\u0445 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u0432, \u043f\u043e\u043f\u0443\u0442\u043d\u043e \u0438\u0437\u0443\u0447\u0430\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u0438\u0442\u0440\u044b\u0435 \u043f\u0440\u0438\u0435\u043c\u044b \u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u044d\u0442\u043e\u0439 \u043a\u0440\u0430\u0441\u043e\u0442\u043e\u0439 \u2014 \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u0430\u044f \u0438\u0433\u0440\u0430 \u0434\u043b\u044f \u043f\u0440\u0430\u0437\u0434\u043d\u043e\u0433\u043e \u0443\u043c\u0430 \u0438\u043b\u0438 \u0433\u043b\u0443\u0431\u043e\u043a\u0430\u044f \u0444\u0438\u043b\u043e\u0441\u043e\u0444\u0441\u043a\u0430\u044f \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0430\u044f \u043e\u0442\u043a\u043b\u0438\u043a\u0438 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-299645","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/299645","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=299645"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/299645\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=299645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=299645"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=299645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}