xxxxxxxxxx
56
function setup() {
createCanvas(400, 400);
// background(0);
// noLoop();
}
function draw() {
}
/*
// VARIABLES
let name = 'Pepito';
let myNumber = 5;
let sentence = name + ' likes the number ' + myNumber;
console.log(sentence)
// FUNCTIONS
// - function definition - create - function draw() {}
// - function excecution - call - ellipse(200,200,100,100);
// - function Parameters function myFunction(parameters){}
// - function Arguments myFunction(arguments)
// - block of code {}
// IF STATEMENTS
// if(question){ if question is true do what is between the block}
// if(question){} else {if question is false do what is in this block}
// if(mouseX > 200){background(0)} else { background(255)}
// WHILE LOOPS
// 3 steps - 1. counter variable - 2. condition(question) 3. action in code block - 4. increase counter
// let counter = 1; while(counter< 20){ellipse(200,20*counter, 50, 50); counter++;}
// FOR LOOP
// Shorthand for while loop
// for(let counter = 1; counter < 20; counter++){ellipse(20*counter, 200, 50,50);}
// ARRAY
// let sillyArray = [1, 4, 6, ['cat', 'bat',['cow',22],'sat'], 99];
// get third element from sillyArray console.log(sillyArray[2]);
// get the cow console.log(console.log(sillyArray[3][2][0]);
//
noStroke();
if(count % 35){
fill(random(255),random(255))
ellipse(random(400),y, random(20));
}
count++;
if(y < 400){
y++;
} else {
y = 0;
}
*/