{"id":67315,"date":"2021-10-09T23:38:05","date_gmt":"2021-10-10T03:38:05","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=67315"},"modified":"2021-10-09T23:38:05","modified_gmt":"2021-10-10T03:38:05","slug":"project-06-abstract-clock-6","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/09\/project-06-abstract-clock-6\/","title":{"rendered":"Project 06: abstract clock"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><pre class=\"wp-block-code\"><code>\n\nfunction setup() {\n    wd = 600\n    ht = 600\n    createCanvas(wd, ht);\n    background(60,80,140);\n}\n\nfunction draw() {\n    background(60,80,140)\n    s = second();\n    m = minute();\n    h = hour();\n   \n    \n    noStroke();\n    \n    xPos = 10*s\n    yPos = 10*s\n    \n    \n    \/\/the minute bar\n    fill(238,229,169)\n    rect(0, 29, wd, 79);\n    rect(0, ht-109, wd, 79);\n    fill(105,160,225)\n    rect(0, 49, wd*(m\/60), 60)\n    rect(0, ht-100, wd*(m\/60), 60)\n        \n    \/\/Hour Circle\n    fill(255);\n    circle(wd\/2, ht\/2, 199)\n    fill(255,81,13)\n    arc(wd\/2, ht\/2, 199, 199, -PI\/2, -PI\/2+h*(2*PI\/12));\n    \n    \/\/Seconds cirlcles\n    fill(230,120,12)\n    \n    if (s &lt;= 30) {\n        circle(xPos, ht\/2, 60);\n    } else {\n        circle(wd\/2, yPos, 60);\n    }\n    \n    if (s &lt;= 30) {\n        circle(wd-xPos, ht\/2, 60);\n    } else {\n        circle(wd\/2, ht-yPos, 60);\n    }\n        \n}<\/code><\/pre><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":656,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[106,56],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/67315"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/users\/656"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=67315"}],"version-history":[{"count":1,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/67315\/revisions"}],"predecessor-version":[{"id":67316,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/67315\/revisions\/67316"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=67315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=67315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=67315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}