{"id":420,"date":"2009-06-20T14:28:28","date_gmt":"2009-06-20T14:28:28","guid":{"rendered":"http:\/\/agraham.org\/blog\/?p=420"},"modified":"2009-08-04T18:53:28","modified_gmt":"2009-08-04T18:53:28","slug":"horrible-code","status":"publish","type":"post","link":"http:\/\/agraham.org\/blog\/2009\/06\/20\/horrible-code\/","title":{"rendered":"Horrible code"},"content":{"rendered":"<p>Going through an <acronym title=\"XNA's Not Acromyned\">XNA<\/acronym> tutorial I came across this:<\/p>\n<pre>\r\n[code lang=\"csharp\"]\r\nprotected void CheckBulletHits()\r\n{\r\n\/\/ Check to see of any of the players bullets have\r\n\/\/ impacted any of the enemies.\r\nfor (int i = 0; i &lt; iMaxBullets; i++)\r\n{\r\nif (bullets[i].IsActive)\r\nfor (int x = 0; x &lt; iTotalMaxEnemies; x++)\r\nif (Enemies[x].IsActive)\r\nif  (Intersects(bullets[i].BoundingBox, Enemies[x].CollisionBox))\r\n{\r\nDestroyEnemy(x);\r\nRemoveBullet(x);\r\n}\r\n}\r\n}\r\n[\/code]\r\n<\/pre>\n<p>Curly braces exist for a reason. (also WordPress displays code blocks crap, had to nest them, time to look for a plugin). Edit &#8211; found.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Going through an XNA tutorial I came across this: [code lang=&#8221;csharp&#8221;] protected void CheckBulletHits() { \/\/ Check to see of any of the players bullets have \/\/ impacted any of the enemies. for (int i = 0; i &lt; iMaxBullets; i++) { if (bullets[i].IsActive) for (int x = 0; x &lt; iTotalMaxEnemies; x++) if (Enemies[x].IsActive) [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[210,51],"tags":[318,317,309],"class_list":["post-420","post","type-post","status-publish","format-standard","hentry","category-coding","category-rant","tag-curly-braces","tag-horrible-code","tag-xna"],"share_on_mastodon":{"url":"","error":""},"_links":{"self":[{"href":"http:\/\/agraham.org\/blog\/wp-json\/wp\/v2\/posts\/420","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/agraham.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/agraham.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/agraham.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/agraham.org\/blog\/wp-json\/wp\/v2\/comments?post=420"}],"version-history":[{"count":13,"href":"http:\/\/agraham.org\/blog\/wp-json\/wp\/v2\/posts\/420\/revisions"}],"predecessor-version":[{"id":481,"href":"http:\/\/agraham.org\/blog\/wp-json\/wp\/v2\/posts\/420\/revisions\/481"}],"wp:attachment":[{"href":"http:\/\/agraham.org\/blog\/wp-json\/wp\/v2\/media?parent=420"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/agraham.org\/blog\/wp-json\/wp\/v2\/categories?post=420"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/agraham.org\/blog\/wp-json\/wp\/v2\/tags?post=420"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}