Week 1 – Self-portrait

Concept

 

 

Code snippet

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
// Declare in the global scope
// All functions will have access to this variable
let myRandomNumber;
function setup() {
createCanvas(300, 400);
myRandomNumber = random(255); // How can we find out what a variable's value is? print()
let myRoundedNumber = round(myRandomNumber);
print('myRandomNumber = ' + myRandomNumber);
print('myRoundedNumber = ' + myRoundedNumber);
}
// Declare in the global scope // All functions will have access to this variable let myRandomNumber; function setup() { createCanvas(300, 400); myRandomNumber = random(255); // How can we find out what a variable's value is? print() let myRoundedNumber = round(myRandomNumber); print('myRandomNumber = ' + myRandomNumber); print('myRoundedNumber = ' + myRoundedNumber); }
// Declare in the global scope
// All functions will have access to this variable
let myRandomNumber;


function setup() {
  createCanvas(300, 400);
  
  myRandomNumber = random(255); // How can we find out what a variable's value is? print()

  let myRoundedNumber = round(myRandomNumber); 
  
  print('myRandomNumber = ' + myRandomNumber);
  print('myRoundedNumber = ' + myRoundedNumber);

  
}

 

Leave a Reply