From af47b5598ea982ab20914443290fc6c716d3e814 Mon Sep 17 00:00:00 2001 From: kapnerd Date: Wed, 2 Dec 2015 14:49:44 -0500 Subject: [PATCH 1/4] Rectangle and circles --- VoidFunctions/VoidFunctions.pde | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/VoidFunctions/VoidFunctions.pde b/VoidFunctions/VoidFunctions.pde index 8b13789..1318c9c 100644 --- a/VoidFunctions/VoidFunctions.pde +++ b/VoidFunctions/VoidFunctions.pde @@ -1 +1,22 @@ +void setup() { + size(800, 600); + noStroke(); +} +void draw() { + blueSquare(); + mouseCircles(random(255), random(255), random(255)); +} + +void blueSquare(){ + rectMode(CENTER); + fill(0,0,255); + rect(width/2,height/2,50,50); +} + +void mouseCircles(float r, float g, float b) { + if (mousePressed) { + fill(r, g, b); + ellipse(mouseX, mouseY, 30, 30); + } +} \ No newline at end of file From a362cc8b24818197bbf2560cf435a5a385704d68 Mon Sep 17 00:00:00 2001 From: kapnerd Date: Fri, 4 Dec 2015 13:33:30 -0500 Subject: [PATCH 2/4] added third function --- VoidFunctions/VoidFunctions.pde | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/VoidFunctions/VoidFunctions.pde b/VoidFunctions/VoidFunctions.pde index 1318c9c..6c3eeb6 100644 --- a/VoidFunctions/VoidFunctions.pde +++ b/VoidFunctions/VoidFunctions.pde @@ -6,6 +6,7 @@ void setup() { void draw() { blueSquare(); mouseCircles(random(255), random(255), random(255)); + keyText(); } void blueSquare(){ @@ -19,4 +20,11 @@ void mouseCircles(float r, float g, float b) { fill(r, g, b); ellipse(mouseX, mouseY, 30, 30); } +} + +void keyText(){ + if(keyPressed){ + fill(0); + text("ayy lmao", random(width), random(height)); + } } \ No newline at end of file From de0e3e16bae9b5b018039e30385182e95df48d88 Mon Sep 17 00:00:00 2001 From: kapnerd Date: Fri, 4 Dec 2015 14:01:19 -0500 Subject: [PATCH 3/4] changed text display --- VoidFunctions/VoidFunctions.pde | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/VoidFunctions/VoidFunctions.pde b/VoidFunctions/VoidFunctions.pde index 6c3eeb6..c60f4ce 100644 --- a/VoidFunctions/VoidFunctions.pde +++ b/VoidFunctions/VoidFunctions.pde @@ -1,6 +1,9 @@ void setup() { size(800, 600); noStroke(); + frameRate(1000000000); + textAlign(CENTER,CENTER); + textSize(20); } void draw() { @@ -21,7 +24,7 @@ void mouseCircles(float r, float g, float b) { ellipse(mouseX, mouseY, 30, 30); } } - + void keyText(){ if(keyPressed){ fill(0); From 0ac39ef04f50169c93fccceea1aed64e36953b30 Mon Sep 17 00:00:00 2001 From: kapnerd Date: Fri, 4 Dec 2015 14:51:02 -0500 Subject: [PATCH 4/4] F to C --- ReturningValues/ReturningValues.pde | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ReturningValues/ReturningValues.pde b/ReturningValues/ReturningValues.pde index 8b13789..91eb3cd 100644 --- a/ReturningValues/ReturningValues.pde +++ b/ReturningValues/ReturningValues.pde @@ -1 +1,8 @@ +float FtoC(float F) { + float C = (F-32)*.555555555556; + return C; +} +void draw() { + println(FtoC(212)); +} \ No newline at end of file