{"id":178,"date":"2011-10-17T00:22:57","date_gmt":"2011-10-17T07:22:57","guid":{"rendered":"http:\/\/courses.haigarmen.com\/isma303\/?p=178"},"modified":"2011-10-17T00:22:57","modified_gmt":"2011-10-17T07:22:57","slug":"growing-shrinking-circle","status":"publish","type":"post","link":"https:\/\/courses.haigarmen.com\/isma303\/growing-shrinking-circle\/","title":{"rendered":"Growing &amp; Shrinking Circle"},"content":{"rendered":"<pre>\nint diam = 10;\nfloat centX, centY;\nboolean growth;\n\nvoid setup() {\n  size(600, 600);\n  frameRate(24);\n  smooth();\n  background(180);\n  centX = width\/2;\n  centY = height\/2;\n  stroke(0);\n  strokeWeight(5);\n  fill(255,50);\n}\n\nvoid draw() {\n  if (growth) {\n    bigger();\n  } else {\n    smaller();\n  };\n}\n\nvoid bigger() {\n    background(180);\n    ellipse(centX, centY, diam, diam);\n    diam += 10;\n    if (diam &gt;=width) {\n      growth = false;\n\n    }\n}\n\nvoid smaller() {\n    background(180);\n    ellipse(centX, centY, diam, diam);\n    diam -= 10;\n    if (diam &lt;=10) {\n    growth = true;\n    }\n}\n<\/pre>\n<p>int diam = 10;<br \/>\nfloat centX, centY;<br \/>\nboolean growth;<\/p>\n<p>void setup() {<br \/>\n  size(600, 600);<br \/>\n  frameRate(24);<br \/>\n  smooth();<br \/>\n  background(180);<br \/>\n  centX = width\/2;<br \/>\n  centY = height\/2;<br \/>\n  stroke(0);<br \/>\n  strokeWeight(5);<br \/>\n  fill(255,50);<br \/>\n}<\/p>\n<p>void draw() {<br \/>\n  if (growth) {<br \/>\n    bigger();<br \/>\n  } else {<br \/>\n    smaller();<br \/>\n  };<br \/>\n}<\/p>\n<p>void bigger() {<br \/>\n    background(180);<br \/>\n    ellipse(centX, centY, diam, diam);<br \/>\n    diam += 10;<br \/>\n    if (diam &gt;=width) {<br \/>\n      growth = false;<\/p>\n<p>    }<br \/>\n}<\/p>\n<p>void smaller() {<br \/>\n    background(180);<br \/>\n    ellipse(centX, centY, diam, diam);<br \/>\n    diam -= 10;<br \/>\n    if (diam &lt;=10) {<br \/>\n    growth = true;<br \/>\n    }<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>int diam = 10; float centX, centY; boolean growth; void setup() { size(600, 600); frameRate(24); smooth(); background(180); centX = width\/2; centY = height\/2; stroke(0); strokeWeight(5); fill(255,50); } void draw() { if (growth) { bigger(); } else { smaller(); }; } void bigger() { background(180); ellipse(centX, centY, diam, diam); diam += 10; if (diam &gt;=width) { [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-178","post","type-post","status-publish","format-standard","hentry","category-exercises"],"_links":{"self":[{"href":"https:\/\/courses.haigarmen.com\/isma303\/wp-json\/wp\/v2\/posts\/178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courses.haigarmen.com\/isma303\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.haigarmen.com\/isma303\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.haigarmen.com\/isma303\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.haigarmen.com\/isma303\/wp-json\/wp\/v2\/comments?post=178"}],"version-history":[{"count":0,"href":"https:\/\/courses.haigarmen.com\/isma303\/wp-json\/wp\/v2\/posts\/178\/revisions"}],"wp:attachment":[{"href":"https:\/\/courses.haigarmen.com\/isma303\/wp-json\/wp\/v2\/media?parent=178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.haigarmen.com\/isma303\/wp-json\/wp\/v2\/categories?post=178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.haigarmen.com\/isma303\/wp-json\/wp\/v2\/tags?post=178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}