From 9e346f8d19af23e21730972150291f81f885d393 Mon Sep 17 00:00:00 2001 From: daena94 Date: Tue, 1 Dec 2015 13:13:06 -0500 Subject: [PATCH 1/3] created functions wasnt sure what "let the user pick the color" meant --- VoidFunctions/VoidFunctions.pde | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/VoidFunctions/VoidFunctions.pde b/VoidFunctions/VoidFunctions.pde index 8b13789..60b7b53 100644 --- a/VoidFunctions/VoidFunctions.pde +++ b/VoidFunctions/VoidFunctions.pde @@ -1 +1,26 @@ +float x; +float y; +void setup() { +size(600,600); +background(0); +} +void draw() { + +DrawABlueSquare(); +DrawACircle(); +DrawARandomLine(); + +} +void DrawABlueSquare(){ +rect(width/2-25,height/2-25,50,50); +fill(0,0,255); +} +void DrawACircle(){ +ellipse(mouseX,mouseY,30,30); +} +void DrawARandomLine(){ +line(random(0,width), 0, random(0,width), height); +stroke(random(255), random(255), random(255)); +strokeWeight(.1); +} \ No newline at end of file From f43394af0c4630473311cc5082a1ca46e48fb296 Mon Sep 17 00:00:00 2001 From: daena94 Date: Thu, 3 Dec 2015 12:52:22 -0500 Subject: [PATCH 2/3] created the Hypotenuse Function --- ReturningValues/ReturningValues.pde | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ReturningValues/ReturningValues.pde b/ReturningValues/ReturningValues.pde index 8b13789..8b1b399 100644 --- a/ReturningValues/ReturningValues.pde +++ b/ReturningValues/ReturningValues.pde @@ -1 +1,11 @@ +void setup() { +} +void draw() { +println(Hypotenuse(5,12)); +} + +float Hypotenuse(float a, float b){ +float c = sqrt(sq(a) + sq(b)); +return c; +} \ No newline at end of file From 5db54f6de8546fd587c753c0547d6425856cafa6 Mon Sep 17 00:00:00 2001 From: daena94 Date: Thu, 3 Dec 2015 12:54:04 -0500 Subject: [PATCH 3/3] created the Sum Function --- ReturningValues/ReturningValues.pde | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ReturningValues/ReturningValues.pde b/ReturningValues/ReturningValues.pde index 8b1b399..308c380 100644 --- a/ReturningValues/ReturningValues.pde +++ b/ReturningValues/ReturningValues.pde @@ -2,10 +2,10 @@ void setup() { } void draw() { -println(Hypotenuse(5,12)); +println(Sum(5,12,15)); } -float Hypotenuse(float a, float b){ -float c = sqrt(sq(a) + sq(b)); -return c; +float Sum(float a, float b, float c){ +float d = a + b + c; +return d; } \ No newline at end of file