{"id":89,"date":"2008-11-10T00:00:44","date_gmt":"2008-11-10T07:00:44","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=95"},"modified":"2008-11-10T00:00:44","modified_gmt":"2008-11-10T07:00:44","slug":"10000-35-ways","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=89","title":{"rendered":"10,000 35 ways, .toString(radix);"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nfor(var i:int = 2; i&lt;37; i++){\r\n\ttrace((10000).toString(i));\r\n}\r\n\/*\r\noutputs:\r\n10011100010000\r\n111201101\r\n2130100\r\n310000\r\n114144\r\n41104\r\n23420\r\n14641\r\n10000\r\n7571\r\n5954\r\n4723\r\n3904\r\n2e6a\r\n2710\r\n20a4\r\n1cfa\r\n18d6\r\n1500\r\n11e4\r\nkec\r\niki\r\nh8g\r\ng00\r\nekg\r\ndja\r\ncl4\r\nbpo\r\nb3a\r\naci\r\n9og\r\n961\r\n8m4\r\n85p\r\n7ps\r\n*\/\r\n<\/pre>\n<p>I had either totally forgotten about or never known about the Number, uint, int etc&#8230; .toString() radix argument. <a href=\"http:\/\/www.guitaryoga.net\">Brock<\/a> mentioned it to me in conversation and I&#8217;ve been having fun with it ever since. It&#8217;s especially nice for tracing out hex numbers:<\/p>\n<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nvar red:Number = 0xFF0000;\r\ntrace(&quot;decimal:&quot;);\r\ntrace(red);\r\ntrace(&quot;hex:&quot;);\r\ntrace(red.toString(16));\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>for(var i:int = 2; i&lt;37; i++){ trace((10000).toString(i)); } \/* outputs: 10011100010000 111201101 2130100 310000 114144 41104 23420 14641 10000 7571 5954 4723 3904 2e6a 2710 20a4 1cfa 18d6 1500 11e4 kec iki h8g g00 ekg dja cl4 bpo b3a aci 9og 961 8m4 85p 7ps *\/ I had either totally forgotten about or never known [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41,21],"tags":[44,45,46],"class_list":["post-89","post","type-post","status-publish","format-standard","hentry","category-number","category-strings","tag-decimal","tag-hex","tag-tostring"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/89","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=89"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/89\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=89"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=89"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=89"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}