From 0fcab3494e7355b66d237de8194d59110e54641a Mon Sep 17 00:00:00 2001 From: shivani517 Date: Tue, 1 Dec 2015 12:46:06 -0500 Subject: [PATCH 1/7] blue square in center --- ReturningValues/ReturningValues.pde | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ReturningValues/ReturningValues.pde b/ReturningValues/ReturningValues.pde index 8b13789..9fb5a51 100644 --- a/ReturningValues/ReturningValues.pde +++ b/ReturningValues/ReturningValues.pde @@ -1 +1,17 @@ +void setup() { + size(800, 600); + +} +void draw() { + drawARect(); + + } + + + +void drawARect() { + float sz = 50; + fill(0, 0, 255); + rect(width/2, height/2, sz, sz); +} \ No newline at end of file From c4f016425fe16772d24ea050e021059927762992 Mon Sep 17 00:00:00 2001 From: shivani517 Date: Tue, 1 Dec 2015 12:52:26 -0500 Subject: [PATCH 2/7] circle drawn at location --- ReturningValues/ReturningValues.pde | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ReturningValues/ReturningValues.pde b/ReturningValues/ReturningValues.pde index 9fb5a51..51b2104 100644 --- a/ReturningValues/ReturningValues.pde +++ b/ReturningValues/ReturningValues.pde @@ -4,14 +4,17 @@ void setup() { } void draw() { - drawARect(); - + drawACircle(); + if(mousePressed){ + } } + + -void drawARect() { - float sz = 50; - fill(0, 0, 255); - rect(width/2, height/2, sz, sz); +void drawACircle() { + float d = 30; + fill(random(0,255),random(0,255),random(0,255)); + ellipse(mouseX,mouseY, d, d); } \ No newline at end of file From 118ab6b6581aab1b7ee5d29265af2601be426362 Mon Sep 17 00:00:00 2001 From: shivani517 Date: Tue, 1 Dec 2015 12:54:17 -0500 Subject: [PATCH 3/7] slight bug fix to second assignment --- ReturningValues/ReturningValues.pde | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ReturningValues/ReturningValues.pde b/ReturningValues/ReturningValues.pde index 51b2104..b179c58 100644 --- a/ReturningValues/ReturningValues.pde +++ b/ReturningValues/ReturningValues.pde @@ -5,8 +5,7 @@ void setup() { void draw() { drawACircle(); - if(mousePressed){ - } + } From edff65eaf1442faf7f7e614e4a90db3c5e3f6511 Mon Sep 17 00:00:00 2001 From: shivani517 Date: Tue, 1 Dec 2015 12:59:02 -0500 Subject: [PATCH 4/7] my own function (triangle colored) --- ReturningValues/ReturningValues.pde | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ReturningValues/ReturningValues.pde b/ReturningValues/ReturningValues.pde index b179c58..d9abe53 100644 --- a/ReturningValues/ReturningValues.pde +++ b/ReturningValues/ReturningValues.pde @@ -4,7 +4,7 @@ void setup() { } void draw() { - drawACircle(); + drawATri(); } @@ -12,8 +12,8 @@ void draw() { -void drawACircle() { +void drawATri() { float d = 30; fill(random(0,255),random(0,255),random(0,255)); - ellipse(mouseX,mouseY, d, d); + triangle(random(0,800), random(0,600), random(0,800), random(0,600), random(0,800), random(0,600)); } \ No newline at end of file From abfa60d5973de3cd7c2a875b56579c9d1f1858ce Mon Sep 17 00:00:00 2001 From: shivani517 Date: Thu, 3 Dec 2015 12:04:26 -0500 Subject: [PATCH 5/7] i switch processing files because i made a mistake --- ReturningValues/ReturningValues.pde | 19 ------------------- VoidFunctions/VoidFunctions.pde | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/ReturningValues/ReturningValues.pde b/ReturningValues/ReturningValues.pde index d9abe53..e69de29 100644 --- a/ReturningValues/ReturningValues.pde +++ b/ReturningValues/ReturningValues.pde @@ -1,19 +0,0 @@ -void setup() { - size(800, 600); - -} - -void draw() { - drawATri(); - - } - - - - - -void drawATri() { - float d = 30; - fill(random(0,255),random(0,255),random(0,255)); - triangle(random(0,800), random(0,600), random(0,800), random(0,600), random(0,800), random(0,600)); -} \ No newline at end of file diff --git a/VoidFunctions/VoidFunctions.pde b/VoidFunctions/VoidFunctions.pde index 8b13789..d9abe53 100644 --- a/VoidFunctions/VoidFunctions.pde +++ b/VoidFunctions/VoidFunctions.pde @@ -1 +1,19 @@ +void setup() { + size(800, 600); + +} +void draw() { + drawATri(); + + } + + + + + +void drawATri() { + float d = 30; + fill(random(0,255),random(0,255),random(0,255)); + triangle(random(0,800), random(0,600), random(0,800), random(0,600), random(0,800), random(0,600)); +} \ No newline at end of file From 50b7fca1688447015b76c6313d8a44f56cb4a76d Mon Sep 17 00:00:00 2001 From: shivani517 Date: Thu, 3 Dec 2015 12:52:10 -0500 Subject: [PATCH 6/7] Pythagorean theorem --- ReturningValues/ReturningValues.pde | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ReturningValues/ReturningValues.pde b/ReturningValues/ReturningValues.pde index e69de29..7301e4a 100644 --- a/ReturningValues/ReturningValues.pde +++ b/ReturningValues/ReturningValues.pde @@ -0,0 +1,16 @@ + +void setup() { + size(800, 600); + +} + +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 b0c994f4d8fb8804ae0d5eb5577b7624a4b01a57 Mon Sep 17 00:00:00 2001 From: shivani517 Date: Thu, 3 Dec 2015 13:10:21 -0500 Subject: [PATCH 7/7] add 3 values --- ReturningValues/ReturningValues.pde | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ReturningValues/ReturningValues.pde b/ReturningValues/ReturningValues.pde index 7301e4a..d013dc6 100644 --- a/ReturningValues/ReturningValues.pde +++ b/ReturningValues/ReturningValues.pde @@ -5,12 +5,13 @@ void setup() { } void draw() { - println(hypotenuse(5,12)); + float d = add3(1,2,3); + println(d); } -float hypotenuse(float a, float b){ - float c=sqrt(sq(a) + sq(b)); - return(c); +float add3(float a, float b,float c){ + float d= a + b + c ; + return d; } \ No newline at end of file