Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions ReturningValues/ReturningValues.pde
Original file line number Diff line number Diff line change
@@ -1 +1,48 @@


//void setup(){


/*************************************************
}


//pythagorean theorem

void draw(){

println(hypot(5,12)); //write a new line each frame of the hypot function with values 5 and 12 for a and b

}

float hypot(float a, float b){ //float new function with variables a and b
float c = sqrt(sq(a) + sq(b)); //pythagorean theorem
return c; //repeat
}


//c = square root of (a squared +b squared)
//sqrt(num);
//sq(num);




**********************************/


//add three values together
void setup(){


}

void draw(){

println(numbers(1,2,3));
}

float numbers(float a, float b, float c){
float d = a+b+c;
return d;
}
34 changes: 34 additions & 0 deletions VoidFunctions/VoidFunctions.pde
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
float a, b, c;
PImage asoue;
void setup() {
size(800, 600);

asoue = loadImage("asoue.jpg");
}

void draw() {
background(255);
drawabluesquare();
drawacircle();
drawanimage(mouseX,mouseY);
}

void drawabluesquare() {
fill(0, 0, 255);
rect(375, 275, 50, 50);
}

void drawacircle() {
setfill(40,195,255);
ellipse(mouseX, mouseY, 30, 30);


}

void drawanimage(float x, float y) {

image(asoue, x,y);
}

void setfill(float r, float g, float b){
fill(r,g,b);
}
Binary file added VoidFunctions/data/asoue.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.