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 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