From be331fe3ba82eb5f4be88adfd577fbb8e9106d3d Mon Sep 17 00:00:00 2001 From: Eric Carlson Date: Wed, 2 Dec 2015 14:51:38 -0500 Subject: [PATCH 1/3] did assignement --- ReturningValues/ReturningValues.pde | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/ReturningValues/ReturningValues.pde b/ReturningValues/ReturningValues.pde index 8b13789..889331e 100644 --- a/ReturningValues/ReturningValues.pde +++ b/ReturningValues/ReturningValues.pde @@ -1 +1,49 @@ +float x,y,z; + +void setup() { + size(800,600); + x=150; + y=27; + z=210; + +} + +void draw() { + drawrect(); + drawcircle(); + colorchange(); +} + + + + +void drawrect() { + fill(0,0,255); + rectMode (CENTER); + rect(width/2,height/2,50,50); +} + +void drawcircle() { +fill(x,y,z); +ellipse(mouseX,mouseY,30,30); +} + + +void colorchange() { + if(mousePressed) { + x=x+10; + y=y+10; + z=z+10; + } + if (x>255) { + x=1; + } + if (y>255) { + y=1; + }if (z>255) { + z=1; + } +} + + \ No newline at end of file From 5bfa9d8e2e33a198fa8c32a43d050beaf4108ba6 Mon Sep 17 00:00:00 2001 From: Eric Carlson Date: Fri, 4 Dec 2015 14:04:03 -0500 Subject: [PATCH 2/3] fixed color --- ReturningValues/ReturningValues.pde | 31 ++++++++--------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/ReturningValues/ReturningValues.pde b/ReturningValues/ReturningValues.pde index 889331e..27a3185 100644 --- a/ReturningValues/ReturningValues.pde +++ b/ReturningValues/ReturningValues.pde @@ -1,18 +1,17 @@ -float x,y,z; + void setup() { size(800,600); - x=150; - y=27; - z=210; + } void draw() { + background(255); drawrect(); - drawcircle(); - colorchange(); + drawcircle(100,0,255); + } @@ -24,26 +23,12 @@ void drawrect() { rect(width/2,height/2,50,50); } -void drawcircle() { -fill(x,y,z); +void drawcircle(float red,float green,float blue) { +fill(red,green,blue); ellipse(mouseX,mouseY,30,30); } -void colorchange() { - if(mousePressed) { - x=x+10; - y=y+10; - z=z+10; - } - if (x>255) { - x=1; - } - if (y>255) { - y=1; - }if (z>255) { - z=1; - } -} + \ No newline at end of file From 4acef6e0af04618ec8169d96b020aee6a75800cd Mon Sep 17 00:00:00 2001 From: Eric Carlson Date: Tue, 8 Dec 2015 13:35:00 -0500 Subject: [PATCH 3/3] final feet to miles --- VoidFunctions/VoidFunctions.pde | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/VoidFunctions/VoidFunctions.pde b/VoidFunctions/VoidFunctions.pde index 8b13789..8956ea9 100644 --- a/VoidFunctions/VoidFunctions.pde +++ b/VoidFunctions/VoidFunctions.pde @@ -1 +1,15 @@ +void setup() { + +} + +void draw() { + println( convertFeetToMiles(10000)); +} + + +float convertFeetToMiles(float imput) { + float result= imput/5280; + return result; + +} \ No newline at end of file