From 3ef68e22ddb1e6a9dc2af0ed0caa2fb1ea7e1cc0 Mon Sep 17 00:00:00 2001 From: treetor10145 Date: Tue, 1 Dec 2015 13:05:10 -0500 Subject: [PATCH 1/2] made square and circle --- VoidFunctions/VoidFunctions.pde | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/VoidFunctions/VoidFunctions.pde b/VoidFunctions/VoidFunctions.pde index 8b13789..5c2bbc4 100644 --- a/VoidFunctions/VoidFunctions.pde +++ b/VoidFunctions/VoidFunctions.pde @@ -1 +1,21 @@ +void setup(){ + size(800,600); +} +void draw(){ + drawabluesquare(); + drawacircle(mouseX,mouseY); +} + +void drawabluesquare(){ + fill(0,0,255); + rect(width/2-25,height/2-25,50,50); +} + +void drawacircle(float x,float y){ + setfill(); + ellipse(mouseX,mouseY,30,30); +} +void setfill(){ + fill(random(255),0,255); +} \ No newline at end of file From af08a20b75e2b4d138a0aa7bc295f93d3adfaad0 Mon Sep 17 00:00:00 2001 From: treetor10145 Date: Thu, 3 Dec 2015 13:21:51 -0500 Subject: [PATCH 2/2] added pyth. theorem and add three numbers --- ReturningValues/ReturningValues.pde | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ReturningValues/ReturningValues.pde b/ReturningValues/ReturningValues.pde index 8b13789..22d8568 100644 --- a/ReturningValues/ReturningValues.pde +++ b/ReturningValues/ReturningValues.pde @@ -1 +1,20 @@ +void setup(){ + size(800,600); + textSize(50); + textAlign(CENTER); +} +void draw(){ + background(0); + pythagorean(5,12); + addthreenumbers(8,98,76); +} +void pythagorean(float x, float y){ + text(sqrt(sq(x) + sq(y)),width/2,height/2); +} +void addthreenumbers(float uno, float dos, float tres){ + float c = uno + dos + tres; + text(c,width/2 + 100,height/2 + 100); +} + + \ No newline at end of file