6.1: While Loop – Processing Tutorial

[ad_1]
In this video, I introduce a fundamental concept of programming: The “Loop”.

Support this channel on Patreon:

Contact:

Send me your questions and coding challenges!:

Link to code on Github:

Processing:
Processing Foundation:
Learning Processing Book:

For More Processing Tutorials:

Comments

24 responses to “6.1: While Loop – Processing Tutorial”

  1. Martin dos Santos Avatar

    If my college teacher putted just "1 bit" of this excitement to the programming classes, I would be happy. But I'm not, and im watching you.
    Thank you. Your videos are awesome. Im from argentina.

  2. Julian Morales Avatar

    Dan I miss to see all this great content, get well soon 🙂

  3. Antonia Yb Avatar

    hi , first of all you rly have an amazing way to teach , and a really fun way 😀
    second of could you plz send me your email ?
    thank you

  4. jus a ggoldcow Avatar

    u R getting good at the back and forth thing dan! lol

  5. Aqib H Avatar

    Hi, During the infinite loop with mouseX, if mouseX is 0 why doesn't it draw a portion of the circle at (0,150)?

  6. Calz20Videos Avatar

    I added a y… kinda could work as a coordinate plane.

  7. Marko Pranjić Avatar

    Instead of adding "fo"r statement inside "while", i just put "x=x+mouseX+1;" and got the same solution, i dont know should i, but i am just a little proud of myself for, making code smaller, by myself.

  8. Zoya Khan Avatar

    i need c compiler

  9. Fry Farnsworth Avatar

    Noob Question. When x is definded as 0 over and over again, this should mean that x = x+10 always definses x as 10, or? I do not get the logic here. Any Help? 🙂

  10. 3D Davis Avatar

    what is with the "do" loop ? how this work

  11. 宋文鹏 Avatar

    hey i have a question Why the video does not end?

  12. Jim Johnston Avatar

    daniel never gets tired

  13. chaiya kheourn Avatar

    I love your teaching so much!

  14. SilenceOfThought Avatar

    hehe

    float circleX, circleY;
    float Xspeed=8, Yspeed=8;

    void setup() {
    size(400, 600);
    background(0);
    fill(255);
    circleX=width/2;
    circleY=height/4;
    }

    void draw() {
    background(0);
    ellipse(circleX, circleY, 30, 30);
    circleX=circleX+Xspeed;
    circleY=circleY+Yspeed;
    if (circleX+15>=width||circleX-15<=0) {
    Xspeed=-Xspeed;
    fill(random(255), random(255), random(255));
    }
    if (circleY+15>=height||circleY-15<=0) {
    Yspeed=-Yspeed;
    fill(random(255), random(255), random(255));
    }
    }

  15. Boyan Sky Avatar

    How to make the code of the bubble falling down? (the begin of this video one)

    thank you~

  16. Kuis N Avatar

    deadmau5 – while(1<2) <3

  17. Vladimir Putin Avatar

    such a good teacher, I bet it's pleasant to hang out with such a positive guy.
    Also, a question. on 7:00
    The while loop updates itself(adds x += 1) every time the draw method is called, and it's called 30 times per second(30 fps is default, I think) . So why we don't see an animation, where every 30th of a second the new circle is being drawn? So basically, I thought that one circle will appear, then the text frame another, and another and so on. They are all being drawn at the beginning of the program.

  18. BABLU KUMAR Avatar

    Hi Daniel,

    I did not understand why did you declare x = 0 again if you had already done that earlier in the beginning float x = 0; ?

  19. Johnny CincoCero Avatar

    How can I turn these sketches into .gifs?

  20. Rodrigo Tallar Avatar

    take your time and dont worry, hopefully we'll get better explanations

  21. Haleem ul Hassan Avatar

    @5:37 I really didnt get the part where while loop does NOT draw how we expected, as you mentioned. The first time we go into the while loop, x = 0. Now in the while loop is the command of printing circles using the value of x. So shouldnt it keep drawing circles till the value of x>width within the while loop? Why did you have to put the value of x=0 again before the while loop to see any kind of result.

    Basically what Im asking is how is the value of x = width on the very second time in the while loop?

  22. hector garlinga Avatar

    the draw function contains a for loop?

Leave a Reply

Your email address will not be published. Required fields are marked *