{"id":80,"date":"2015-06-16T05:35:57","date_gmt":"2015-06-16T01:35:57","guid":{"rendered":"http:\/\/courses.haigarmen.com\/creativecoding\/?p=80"},"modified":"2015-06-16T05:35:57","modified_gmt":"2015-06-16T01:35:57","slug":"exercise-16","status":"publish","type":"post","link":"https:\/\/courses.haigarmen.com\/creativecoding\/exercise-16\/","title":{"rendered":"Exercise 16"},"content":{"rendered":"<p>Random Bar Code Generator<\/p>\n<pre>\r\n<code>\r\nfloat x = 0;\r\n\r\nvoid setup() {\r\n  size(400, 400);\r\n  background(255);\r\n  stroke(255);\r\n}\r\n\r\nvoid draw() {\r\n  line(x, 200, x, 100);\r\n  x = x + 1;\r\n\r\n  if (x > width) {\r\n    x = 0;\r\n  }\r\n  \/\/ sometimes we decide to change the line color\r\n  if (random(100) > 70) {\r\n    \r\n    \/\/ now we decide if to use black or white\r\n    if (random(100) > 50) {\r\n      stroke(0);\r\n    } \r\n    else {\r\n      stroke(255);\r\n    }\r\n    \r\n  }\r\n}\r\n<\/code>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Random Bar Code Generator float x = 0; void setup() { size(400, 400); background(255); stroke(255); } void draw() { line(x, 200, x, 100); x = x + 1; if (x > width) { x = 0; } \/\/ sometimes we decide to change the line color if (random(100) > 70) { \/\/ now we decide [&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-80","post","type-post","status-publish","format-standard","hentry","category-lessons"],"_links":{"self":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/80","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=80"}],"version-history":[{"count":1,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/80\/revisions"}],"predecessor-version":[{"id":81,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/80\/revisions\/81"}],"wp:attachment":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/media?parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/categories?post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/tags?post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}