{"id":448,"date":"2009-12-04T08:43:28","date_gmt":"2009-12-04T15:43:28","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=2494"},"modified":"2009-12-04T08:43:28","modified_gmt":"2009-12-04T15:43:28","slug":"copy-an-arbitrary-piece-of-code","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=448","title":{"rendered":"Paste an Arbitrary Piece of Code"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\n...\r\n\/\/ loop through until we find the root note\r\n\t\/\/ grab the third and the fifth and exit the loop\r\n\tfor (var i:int = 0; i&lt;leng; i++){\r\n\t\tif (cMajor&#x5B;i] == note){\r\n\t\t\tthird = cMajor&#x5B;(i + 2) % leng];\r\n\t\t\tfifth = cMajor&#x5B;(i + 4) % leng];\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\t\/\/ we may need a double sharp on the middle note\r\n\tvar sharpFlatDouble:String = sharpFlat;\r\n\t\r\n\t\/\/ check if this is a sharp, check if it is A or D\r\n\t\/\/ if it is add the symbol for double sharp\r\n\tif (sharpFlat == &quot;#&quot;){\r\n\t\tif (note == &quot;D&quot; || note == &quot;A&quot;){\r\n\t\t\tsharpFlatDouble = &quot;x&quot;;\r\n\t\t}\r\n\t}\r\n...\r\n<\/pre>\n<p>If your working on some code&#8230; just randomly copy a piece of it and paste it in the comments&#8230; This code is from a program that generates any major scale (it&#8217;s still not finished). Feel free to post code chunks in any language&#8230;<\/p>\n<p>[EDIT] the code doesn&#8217;t need to work on its own&#8230; you can just randomly copy from something your working on&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8230; \/\/ loop through until we find the root note \/\/ grab the third and the fifth and exit the loop for (var i:int = 0; i&lt;leng; i++){ if (cMajor&#x5B;i] == note){ third = cMajor&#x5B;(i + 2) % leng]; fifth = cMajor&#x5B;(i + 4) % leng]; break; } } \/\/ we may need a double [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[94],"tags":[3,14,4],"class_list":["post-448","post","type-post","status-publish","format-standard","hentry","category-misc","tag-actionscript","tag-as3","tag-flash"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/448","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=448"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/448\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}