{"id":504,"date":"2010-04-05T08:04:59","date_gmt":"2010-04-05T15:04:59","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=2882"},"modified":"2010-04-05T08:04:59","modified_gmt":"2010-04-05T15:04:59","slug":"recursion-form","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=504","title":{"rendered":"Recursion Form"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nx = y = 10\r\ngraphics.lineStyle(1,0);\r\ndrawBox(6);\r\n\r\nfunction drawBox(iter:Number=10, count:Number=1, y:Number=0, w:Number=500):void{\r\n       if (count &lt; iter){\r\n               var width:Number = w \/ count\r\n               for (var i:int = 0; i&lt;count; i++){\r\n                   graphics.drawRect(i * width, width * count\/w, width, width);\r\n               }\r\n               count++;\r\n               drawBox(iter, count, y, width);\r\n       }\r\n}\r\n<\/pre>\n<p>This small snippet just draws this image:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/actionsnippet.com\/wp-content\/rec_boxes.gif\" \/><\/p>\n<p>If you have an idea for a  short recursive snippet. Feel free to post it in the comments. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>x = y = 10 graphics.lineStyle(1,0); drawBox(6); function drawBox(iter:Number=10, count:Number=1, y:Number=0, w:Number=500):void{ if (count &lt; iter){ var width:Number = w \/ count for (var i:int = 0; i&lt;count; i++){ graphics.drawRect(i * width, width * count\/w, width, width); } count++; drawBox(iter, count, y, width); } } This small snippet just draws this image: If you have [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,33],"tags":[3,14,4],"class_list":["post-504","post","type-post","status-publish","format-standard","hentry","category-functions","category-graphics","tag-actionscript","tag-as3","tag-flash"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/504","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=504"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/504\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=504"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=504"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=504"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}