<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hunar Ahmad</title>
    <description>The latest articles on DEV Community by Hunar Ahmad (@hunar4321).</description>
    <link>https://dev.to/hunar4321</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F924182%2F9534be9a-2ee5-4f37-95f2-34939c555dbb.png</url>
      <title>DEV Community: Hunar Ahmad</title>
      <link>https://dev.to/hunar4321</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hunar4321"/>
    <language>en</language>
    <item>
      <title>How to Create Complexity from Simple Rules</title>
      <dc:creator>Hunar Ahmad</dc:creator>
      <pubDate>Sat, 24 Sep 2022 08:58:48 +0000</pubDate>
      <link>https://dev.to/hunar4321/how-to-create-complexity-from-simple-rules-1448</link>
      <guid>https://dev.to/hunar4321/how-to-create-complexity-from-simple-rules-1448</guid>
      <description>&lt;p&gt;The following is a very simple bared-down code necessary to produce Mandelbrot in your browser&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  &amp;lt;canvas id="gardun" width="1000" height="1000"&amp;gt;&amp;lt;/canvas&amp;gt;
  &amp;lt;script&amp;gt;
  m = document.getElementById("gardun").getContext("2d")
  atom = function(x,y,c){m.fillStyle=c; m.fillRect(x,y,3,3)}
  for(y=1; y&amp;lt;1000; y++){
  for(x=1; x&amp;lt;1000; x++){
  dx = (x-500)/2000-0.12
  dy = (y-500)/2000-0.82
  a = dx
  b = dy
  for(t=1; t&amp;lt;200; t++){
  d = (a*a)-(b*b)+dx
  b = 2*(a*b)+dy
  a = d
  H = d&amp;gt;200
  if(H){atom(x,y,"rgb("+ t*3 +","+ t +","+ t*0.5 +")"); break}
  }}}
  &amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The step by step tutorial and explanation is also available on YouTube for those interested:&lt;br&gt;
&lt;a href="https://youtu.be/mzizK6ms-gY"&gt;https://youtu.be/mzizK6ms-gY&lt;/a&gt;&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>javascript</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Artificial Particle Life</title>
      <dc:creator>Hunar Ahmad</dc:creator>
      <pubDate>Sat, 10 Sep 2022 23:20:55 +0000</pubDate>
      <link>https://dev.to/hunar4321/artificial-particle-life-2jpc</link>
      <guid>https://dev.to/hunar4321/artificial-particle-life-2jpc</guid>
      <description>&lt;p&gt;Recently, I made an educational simulation project on what is known as Particle Life to showcase how complexity can arise from simplicity. Particle Life is like Conway’s game of life but in Conway’s game of life the effect of the particles are confined to their surrounding neighbors only while in these simulations particles have effects on each other over longer distances. Also, the interactions rely on Newtonian like attraction/repulsion forces among the interacting particles.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--K18FWKX9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n160k2a1esrgkq00tuaj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--K18FWKX9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n160k2a1esrgkq00tuaj.jpg" alt="Image description" width="880" height="492"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Video Tutorial: &lt;a href="https://youtu.be/0Kx4Y9TVMGg"&gt;https://youtu.be/0Kx4Y9TVMGg&lt;/a&gt;&lt;br&gt;
Source code: &lt;a href="https://github.com/hunar4321/particle-life"&gt;https://github.com/hunar4321/particle-life&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>tutorial</category>
      <category>opensource</category>
      <category>algorithms</category>
    </item>
  </channel>
</rss>
