{"id":136,"date":"2015-06-17T07:12:54","date_gmt":"2015-06-17T03:12:54","guid":{"rendered":"http:\/\/courses.haigarmen.com\/creativecoding\/?p=136"},"modified":"2015-06-17T07:18:30","modified_gmt":"2015-06-17T03:18:30","slug":"exercise-27","status":"publish","type":"post","link":"https:\/\/courses.haigarmen.com\/creativecoding\/exercise-27\/","title":{"rendered":"Exercise 27"},"content":{"rendered":"<p>Adding a small probability of a red square to our grid<\/p>\n<pre><code>\r\nsize(400, 400);\r\nnoStroke();\r\nbackground(255);\r\n\r\nfloat x = 0;\r\nwhile (x < width) {\r\n  float y = 0;\r\n  while (y < height) {\r\n        if (random(100) > 98) {\r\n      fill(255, 0, 0);\r\n    } \r\n    else {\r\n      \/\/ but usually pick a random gray color\r\n      fill(random(100, 200));\r\n    }\r\n\r\n    rect(x, y, 38, 38);\r\n    y = y + 40;\r\n  }\r\n  x = x + 40;\r\n}\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Adding a small probability of a red square to our grid size(400, 400); noStroke(); background(255); float x = 0; while (x < width) { float y = 0; while (y < height) { if (random(100) > 98) { fill(255, 0, 0); } else { \/\/ but usually pick a random gray color fill(random(100, 200)); } [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-136","post","type-post","status-publish","format-standard","hentry","category-lessons"],"_links":{"self":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/comments?post=136"}],"version-history":[{"count":1,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/136\/revisions"}],"predecessor-version":[{"id":137,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/136\/revisions\/137"}],"wp:attachment":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/media?parent=136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/categories?post=136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/tags?post=136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}