From bb48c114f99777594e82c6ce9a879478149b82b9 Mon Sep 17 00:00:00 2001 From: SMoy17 Date: Wed, 2 Dec 2015 14:50:57 -0500 Subject: [PATCH 1/3] One Function --- VoidFunctions/VoidFunctions.pde | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/VoidFunctions/VoidFunctions.pde b/VoidFunctions/VoidFunctions.pde index 8b13789..3af407b 100644 --- a/VoidFunctions/VoidFunctions.pde +++ b/VoidFunctions/VoidFunctions.pde @@ -1 +1,19 @@ +void setup() { + size(800,600); +} +void draw() { + background(0); + blueSquare(); + mouseCircle(); +} + +void blueSquare() { + fill(0,0,255); + rect(375,275,50,50); +} + +void mouseCircle() { + fill( + ellipse(mouseX,mouseY,30,30); +} \ No newline at end of file From e51148c4cb39d374df6f00319ff459f7afb441fd Mon Sep 17 00:00:00 2001 From: SMoy17 Date: Fri, 4 Dec 2015 14:02:12 -0500 Subject: [PATCH 2/3] Finished Three Functions --- VoidFunctions/VoidFunctions.pde | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/VoidFunctions/VoidFunctions.pde b/VoidFunctions/VoidFunctions.pde index 3af407b..4dfcf76 100644 --- a/VoidFunctions/VoidFunctions.pde +++ b/VoidFunctions/VoidFunctions.pde @@ -1,19 +1,33 @@ void setup() { - size(800,600); + //canvas size + size(800, 600); } void draw() { + //black background background(0); + //three functions blueSquare(); - mouseCircle(); + mouseCircle(100,0,255); + randomTriangle(); } +//draw blue square at center void blueSquare() { - fill(0,0,255); - rect(375,275,50,50); + fill(0, 0, 255); + rect(375, 275, 50, 50); } -void mouseCircle() { - fill( - ellipse(mouseX,mouseY,30,30); +//draw circle at mouse +void mouseCircle(float red, float green, float blue) { + fill(red, green, blue); + ellipse(mouseX, mouseY, 30, 30); +} + +//draw random triangles when mouse pressed +void randomTriangle() { + fill(255,255,255); + if (mousePressed) { + triangle(random(800), random(600), random(800), random(600), random(800), random(600)); + } } \ No newline at end of file From 9734c7c8cb05a8a541763174a37369b82bbce027 Mon Sep 17 00:00:00 2001 From: SMoy17 Date: Tue, 8 Dec 2015 13:59:31 -0500 Subject: [PATCH 3/3] Finished Returning Values --- ReturningValues/ReturningValues.pde | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ReturningValues/ReturningValues.pde b/ReturningValues/ReturningValues.pde index 8b13789..67dad01 100644 --- a/ReturningValues/ReturningValues.pde +++ b/ReturningValues/ReturningValues.pde @@ -1 +1,11 @@ +void setup() { +} + +void draw() { +println(theAnswer()); +} + +int theAnswer() { + return 42; +} \ No newline at end of file