{"id":70634,"date":"2022-09-08T21:59:23","date_gmt":"2022-09-09T01:59:23","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=70634"},"modified":"2022-09-08T22:28:49","modified_gmt":"2022-09-09T02:28:49","slug":"project-01-10","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/08\/project-01-10\/","title":{"rendered":"project 01"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><div><a class=\"p5_sketch_link\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/sketch-118.js\" data-width=\"450\" data-height=\"550\">sketch<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"450\" height=\"550\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">function setup() {\n    createCanvas(450, 550);\n    background(220);\n    text(\"p5.js vers 0.9.0 test.\", 10, 15);\n}\nfunction draw() {\n    background(245,245,220);\n    fill(100);\n    noStroke();\n    triangle(width\/2, 400, width,550, 0, 550 );\n    if(mouseX &gt; 400){\n                \/\/body\n       \n        background(200,200, random(0,200));\n        fill(random(100,200),random(30,150), random(100,255));\n        triangle(width\/2, 400, width-random(20,50),550, 0, 550-random(20,50) );\n        fill(225,200,255);\n        strokeWeight(1);\n        stroke(100);\n        ellipse(width\/2 +10, 270, 350, 470);\n        fill(255);\n        strokeWeight(random(1,10));\n        stroke(200,190,255);\n        ellipse(125-random(0,10),200,40,130);\n        ellipse(325-random(0,20),200,170,60);\n        fill(random(0,10),random(20,70),random(10,20));\n        circle(125,200,55);\n        fill(random(0,10),random(20,70),random(10,20));\n        circle(350,200,80);\n        strokeWeight(2);\n        fill(random(0,255),random(100,200),random(100,200));\n        circle(125,200,random(10,40));\n        fill(random(100,200),random(0,200),random(100,200));\n        circle(350,200,random(30,60));\n        strokeWeight(3);\n        stroke(200,200,100);\n        fill(0);\n        \/\/nose\n        line(width\/2-random(0,7),220-random(0,5), width\/2 -20,350 );\n        line(width\/2 -20,350, 300,300-random(0,7) );\n        triangle(width\/2 -20,350, width\/2 -15, 315, width\/2 -7, 350);\n        \/\/mouth + teeth\n        stroke(60);\n        fill(255,30,100);\n        arc(width\/2,400,100,100,0,PI);\n        fill(250);\n        rect(width\/2-20-random(0,5),400,15,25);\n        square(width\/2-10-random(0,5),400,20);\n        rect(width\/2-random(0,5),400,20,30);\n        square(width\/2+10-random(0,5),400,20);\n        square(width\/2+20-random(0,5),400,20);\n        \/\/ hair\n\n    } else {\n        \/\/face\n        fill(225,200,183);\n        strokeWeight(1);\n        stroke(100);\n        ellipse(width\/2 +10, 270, 350, 470);\n        \/\/eyes\n        fill(250);\n        strokeWeight(2);\n        stroke(3);\n        ellipse(150,210,70, mouseX+40);\n        ellipse(340,210,70,mouseX+40);\n        fill(78,53,36);\n        circle(150,210,30);\n        fill(78,53,36);\n        circle(340,210,30);\n        \/\/nose\n        strokeWeight(1);\n        fill(225,184,153);\n        ellipse(width\/2+10, 280, 12, 100);\n        ellipse(width\/2+10, 324,40,25);\n        fill(0);\n        circle(width\/2,326, 7);\n        circle(width\/2 + 15,326, 7);\n        \/\/ mouth\n        strokeWeight(10);\n        stroke(255,10,30);\n        ellipse(width\/2, 400, mouseX+20, 95);\n        \/\/hair\n        strokeWeight(10);\n        stroke(0);\n        line(width\/2 -110,100,mouseX-110,mouseY);\n        line(width\/2 -90,100, mouseX-90,mouseY);\n        line(width\/2 -70,100, mouseX-70,mouseY);\n        line(width\/2 -50,100, mouseX-50,mouseY);\n        line(width\/2 -30,100, mouseX-30,mouseY);\n        line(width\/2 -10,100, mouseX-10,mouseY);\n        line(width\/2 +10,100, mouseX+10,mouseY);\n        line(width\/2 +30,100, mouseX+30,mouseY);\n        line(width\/2 +50,100, mouseX+50,mouseY);\n        line(width\/2 +70,100, mouseX+70,mouseY);\n        line(width\/2 +90,100, mouseX+90,mouseY);\n        line(width\/2 +110,100, mouseX+90,mouseY);\n\n        line(width\/2 -100,80,mouseX-110,mouseY);\n        line(width\/2 -80,80, mouseX-90,mouseY);\n        line(width\/2 -60,80, mouseX-70,mouseY);\n        line(width\/2 -40,80, mouseX-50,mouseY);\n        line(width\/2 -20,80, mouseX-30,mouseY);\n        line(width\/2 ,80, mouseX-10,mouseY);\n        line(width\/2 +20,80, mouseX+10,mouseY);\n        line(width\/2 +40,80, mouseX+30,mouseY);\n        line(width\/2 +60,80, mouseX+50,mouseY);\n        line(width\/2 +80,80, mouseX+70,mouseY);\n        line(width\/2 +100,80, mouseX+90,mouseY);\n        line(width\/2 +120,80, mouseX+90,mouseY);\n\n        line(width\/2 -90,60, mouseX-90,mouseY);\n        line(width\/2 -70,60, mouseX-70,mouseY);\n        line(width\/2 -50,60, mouseX-50,mouseY);\n        line(width\/2 -30,60, mouseX-30,mouseY);\n        line(width\/2 -10,60, mouseX-10,mouseY);\n        line(width\/2 +10,60, mouseX+10,mouseY);\n        line(width\/2 +30,60, mouseX+30,mouseY);\n        line(width\/2 +50,60, mouseX+50,mouseY);\n        line(width\/2 +70,60, mouseX+70,mouseY);\n        line(width\/2 +90,60, mouseX+90,mouseY);\n        \n    }\n\n\n\n\n}\n<\/code><\/pre><\/div><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>sketch function setup() { createCanvas(450, 550); background(220); text(&#8220;p5.js vers 0.9.0 test.&#8221;, 10, 15); } function draw() { background(245,245,220); fill(100); noStroke(); triangle(width\/2, 400, width,550, 0, 550 ); if(mouseX &gt; 400){ \/\/body background(200,200, random(0,200)); fill(random(100,200),random(30,150), random(100,255)); triangle(width\/2, 400, width-random(20,50),550, 0, 550-random(20,50) ); fill(225,200,255); strokeWeight(1); stroke(100); ellipse(width\/2 +10, 270, 350, 470); fill(255); strokeWeight(random(1,10)); stroke(200,190,255); ellipse(125-random(0,10),200,40,130); ellipse(325-random(0,20),200,170,60); fill(random(0,10),random(20,70),random(10,20)); circle(125,200,55); &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/08\/project-01-10\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;project 01&#8221;<\/span><\/a><\/p>\n","protected":false},"author":738,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[10,55],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/70634"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/users\/738"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/comments?post=70634"}],"version-history":[{"count":14,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/70634\/revisions"}],"predecessor-version":[{"id":70662,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/70634\/revisions\/70662"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=70634"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=70634"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=70634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}