4.1: while and for Loops - p5.js tutorial

preview_player
Показать описание


Timestamps:
0:00 Introduction
1:30 Control Structure of a Loop
1:46 While Loops
3:19 Initializing Local variables
5:50 Exit conditions
9:45 For Loops
12:00 Shorthand for Incrementation

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

#basics #forloop #p5js #javascript
Рекомендации по теме
Комментарии
Автор

It's not that you're just good at explaining, it's that you're good a at inspiring ideas.

jimmybuck
Автор

I don’t know anyone else who smiles this much while coding

acinaces
Автор

Omg you are so good at explaining things I’m recommending to anyone who needs these tutorials

cristaldominguez
Автор

U're the best teacher i've ever seen. I wish all the best for you from Turkey!!!

tahaozalozkan
Автор

you are an incredible and passionate teacher who makes even boring stuffs look really really really interesting !

i resolved to make this comment every time i watch your vid
comment 2/x

persenbp
Автор

Hi Daniel! Nice tutorials. Loved your way of presenting them with a smile. Keep it on. Also you keep on asking if any one would watch them...let me tell you I am watching them for last 4+ hours. :)

akhilkashyep
Автор

I've been lost this whole time between for loop and while loop. Thank you for explaining it to us so clearly.

hanf
Автор

Thanks. I have watched a lot of lessons regarding for and while loops, but yours is the most concise and easiest to understand.

chaios
Автор

Daniel, if everybody else were as clear and understandable as you, our nations might have world peace at last!!!

GraceandWisdom
Автор

I respect you 3000 . Best Teacher on the planet!

poojabennabhaktula
Автор

This guy's teaching style is brilliant and i can totally see why its worthwhile showing us the while loop. It help me understand the concept of for loops so much more clearly..I bookmarked the page and subscribed to the channel...I am officially on the coding train :)

AntonioRibeiro-qsfy
Автор

About 11:25 into the video, line number "17" is highlighted in yellow because the IDE is issuing a warning that the variable "x" has already been declared. To read the actual warning message, just click on the yellow highlighted line number and the text will appear in a little pop-up text box. To correct this warning, remove "var" from within the for loop's argument list, like so:


for (x = 0; x < width; x = x + 50) {


You should find that this fix will make the warning go away. I'm sure Dan knows about this, but didn't want to waste time talking about this small detail in order to keep his video short (under 10 minutes).

randmorf
Автор

Tahnk you so much for doing these videos, I gave it a shot using the map() funct + for loop. Early days, slow progress but enjoying the train ride!
function setup() {
createCanvas(600, 400);
}

function draw() {
noStroke();
background(220);
var minCol = color(51, 59, 53);
var maxCol = color(137, 156, 142);


for (var x = 0; x <= width; x = x + 50){
var mapVal = map(x, 0, width, 0, 1);
var lerpedColor = lerpColor(minCol, maxCol, mapVal);
fill(lerpedColor);
ellipse(x, 200, 45);

}


}

Mon
Автор

You saving my LIFE... thank you soo much... regards from Germany ;)

mediafilms
Автор

Worth mentioning that there's also a shorthand *++i* . Which differs from *i++* because if you have *++i* in an expression *i* is first incremented and only after evaluated.

FredoCorleone
Автор

best programming tutorial ive ever seen!!!!

stan
Автор

Hi Dan, I've thoroughly enjoyed all your videos and my javascript is rapidly improving. Thanks so much for all your efforts and great job sir!

stodsy
Автор

Your videos are really very very helpful. I was lagging in this topic for weeks you cleared it. Appreciated it good work.
regards from India.

snimerjotsingh
Автор

Thank you for making the content understandable for beginners! You did an amazing job of it.

kimchimang
Автор

I love your way of explaining, and also the format of your video, very unique and useful for the explanaition

karenpoveda