ICL
  • Intro to Computational Language
  • Academic Policy
  • Week 01
  • Week 02
  • Week 03
  • Week 04
  • Week 05
  • Week 06
  • Week 07
  • Week 08
  • Week 09
  • Week 10
  • Week 11
  • Week 12
  • Week 13
  • Week 14
  • Week 15
  • Portfolio
Powered by GitBook
On this page
  • 1. Variable
  • 2. Let and Variable
  • 3. console.log()
  • 4. Animation
  • 5. Assignment

Week 03

Animation, Variables, Interaction

PreviousWeek 02NextWeek 04

Last updated 6 years ago

1. Variable

number

var s = 90; 

string

var name = "don"

object

var circle = {
    radius: 13,
    x: 60,
    y: 100
};


circle.radius 
circle.x
circle.y

array

var num = [1, 2, 3];


num[0]
num[1]
num[2]

2. Let and Variable

let allows you to declare variables that are limited in scope to the block, statement, or expression on which it is used. This is unlike the var keyword, which defines a variable globally, or locally to an entire function regardless of block scope.

let x = 1;

3. console.log()

4. Animation

What is animation? Either something that moves by the intention of the user or something that moves automatically for the better interaction in functionality and emotions.

random()

// random in number
random(50); // range in 0 to 50
random(-50, 50); // range in -50 to 50 


//random in  string
var words = ['a', 'b', 'c', 'd'];
var word = random(words); // select a random word from a,b,c,d

mouseX, mouseY

  ellipse(mouseX, mouseY, 24, 24);
  ellipse(mouseX, mouseY,mouseX, mouseY);

map()

map(which value had current range,currentMin,currentMax,newMin,newMax)

mousePressed()

function mousePressed() {
};

5. Assignment

Make any project that interacts with the user.

Always submit link as an editor view from now on.

이상은

이의진

이가하

이다영

Celso Urroz

Lukas Merten

Alexis Sechoir

이재은

김다인

김지원

Submit here:

https://editor.p5js.org/kdoodoo/sketches/S1eJIVpdQ
https://editor.p5js.org/kdoodoo/sketches/rJ1s90hdm
https://jsfiddle.net/kdoodoo/c0esafg4/
https://editor.p5js.org/kdoodoo/sketches/Hy1BtR3u7
https://editor.p5js.org/kdoodoo/sketches/HJlfT03um
https://jsfiddle.net/kdoodoo/53graLpd/
https://editor.p5js.org/kdoodoo/sketches/H1gGsETOQ
https://editor.p5js.org/kdoodoo/sketches/ByYWeS6uX
https://goo.gl/forms/zlr9n5bNbT0iPTyJ2
https://jsfiddle.net/53graLpd/30/#
https://editor.p5js.org/full/ByYWeS6uX
https://editor.p5js.org/full/Byj_iMRdQ
https://editor.p5js.org/full/rJPBA0Vu7
https://editor.p5js.org/celso/sketches/rJmulVLY7
https://editor.p5js.org/lukasmerten321123@gmail.com/sketches/BybhwppY7
https://editor.p5js.org/full/Syd2KgCF7
https://editor.p5js.org/gojenn90@gmail.com/sketches/rJQLTH15Q
https://editor.p5js.org/dain5832/sketches/BJWoBskcQ
https://editor.p5js.org/dion/sketches/rk8zWLCKQ