5.1: Boolean Expressions - Processing Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ก.ค. 2015
  • This video covers the very basics of a conditional statement and a boolean expression.
    Support this channel on Patreon: / codingtrain
    Contact: / shiffman
    Send me your questions and coding challenges!: github.com/CodingTrain/Rainbo...
    Link to code on Github: github.com/CodingTrain/Rainbo...
    Processing: processing.org
    Processing Foundation: processingfoundation.org/
    Learning Processing Book: learningprocessing.com/
    For More Processing Tutorials:
    th-cam.com/users/shiffman...
    📄 Code of Conduct: github.com/CodingTrain/Code-o...

ความคิดเห็น • 93

  • @taebyun561
    @taebyun561 6 ปีที่แล้ว +40

    This is such an encouraging course. " you can code anything you want from now on". So so happy for that!

  • @haleemulhassan9158
    @haleemulhassan9158 8 ปีที่แล้ว +93

    Thank you so much Mr Daniel. Im just learning processing because i need it as a design student for my senior project which has interactive elements. Im already in the middle of the semester and your videos are giving me an amazing jumpstart to deal with this world of programming. You explain stuff brilliantly, keep it entertaining ALL the time, and constantly challenge your viewers and their imagination as well. You have perfected the art of teaching! :D Big fan here, keep up the great work :)

    • @TheCodingTrain
      @TheCodingTrain  8 ปีที่แล้ว +7

      +Haleem ul Hassan thanks you so much for this very kind feedback!

  • @MahadKhaliq
    @MahadKhaliq 6 ปีที่แล้ว +20

    A lot of respect for you Sir! I wish my university teachers could also clear all my concepts like this!

  • @Mike-sb3uc
    @Mike-sb3uc 5 ปีที่แล้ว +7

    Wow, usually it takes me like 10 times to read something or listen to something so I can understand the problem. When I watch your videos I understand it immidietly .. this is amazing, you are an amazing teacher.

  • @robiecalong2
    @robiecalong2 6 ปีที่แล้ว +1

    Watching your tutorial videos for learning processing has been a great experience. I appreciate that you give coding examples through a visual context, as I myself is more of a visual learner.

  • @crisis7782
    @crisis7782 7 ปีที่แล้ว +4

    I´m been trying to learn how to code for a long time without any succes until now.
    Thanks a lot, Daniel!!!! you are a great great teacher!!

  • @camiladesa2375
    @camiladesa2375 3 ปีที่แล้ว +1

    I suffer a lot trying to understand what my professor does in class, and here I am, doing the programming class again, but now with this HUGE help that made me understand a semester thing in hours. RESPECT FOR THIS MAN.

  • @headlights-go-up
    @headlights-go-up 5 ปีที่แล้ว

    I know I'm late to your videos, but you're an excellent teacher. Not only do you explain things very well and are able to show everything, but you're very relatable and charismatic which (obviously) is great for teaching. Thank you for your hard work!

  • @videofreak29101
    @videofreak29101 4 ปีที่แล้ว +1

    I love your videos, Daniel. I have decided to study computer science at university this summer, and your videos really have helped learn about the basics of programming. Thank you

  • @paladin1147
    @paladin1147 5 ปีที่แล้ว +1

    The only good thing going for me in my life is you, good sir. YOU ARE AMAZING! xD. Never stop these videos. Can you believe that thousands of people literally thousands even more around the globe is benefiting from this .

  • @jimins_missing_height
    @jimins_missing_height ปีที่แล้ว +1

    I really love how You teach. You make Learning so Easy and Fun. I enjoy Studying from You very much, and Your Little 'Jokes' Around (Like the pen...) Are very Sweet.

  • @pareshpandit
    @pareshpandit 2 ปีที่แล้ว

    You are a marvellous teacher. So glad to have found your channel! 🙏🏼🙂🌱

  • @sandipbaidya2839
    @sandipbaidya2839 6 ปีที่แล้ว +2

    I really like your lessons, certainly more interactive than the ones they pretend to drag at colleges. Well at mine. Love the way you keep it all unrefined, gives me kind of a comfortable vibe, wish we had teachers like you here. Anyway thanks for uploadin!

  • @javiermartinezdevelasco8515
    @javiermartinezdevelasco8515 8 ปีที่แล้ว +8

    You made it!!!! I started programming with Processing3. Also the videos you have at www.processing.org are wonderful.
    Great teacher!!
    Thanks a lot, Daniel!!!! You are the boss!!!!!!
    I've seen so many videos of you that I can just address you by Daniel and not Mr. Shiffman! hahaha We are buddies now.
    Thanks a lot, for real.

    • @TheCodingTrain
      @TheCodingTrain  8 ปีที่แล้ว +2

      +Javier Martínez de Velasco thanks so much for watching, of course you can call me Daniel!

  • @samuilnikolov4655
    @samuilnikolov4655 7 ปีที่แล้ว +3

    AGAIN AMAZING VIDEO DUDE
    KEEP GOING
    THE CODE FROM THE LAST FEW SECONDS WHICH WERE TASK
    float circleX=0;
    void setup()
    {
    size(640,360);
    }
    void draw()
    {
    background(50);
    fill(225);
    ellipse(circleX,180,24,24);
    circleX=circleX+1;
    if(circleX>=640)
    {
    circleX=0;
    }
    }

  • @Kta8548i
    @Kta8548i 5 ปีที่แล้ว

    Thanks for your coding lessons i wish i had a teacher like you

  • @pusji
    @pusji 8 ปีที่แล้ว +15

    you're lovely! I've almost started to like coding. clear, simple and entertaining explanations, thank u!

  • @user-ec3ju6vy3d
    @user-ec3ju6vy3d 8 หลายเดือนก่อน

    great video!! thank you for your valuable contribution to the research. let me tell you something: you made my day.

  • @bernym4047
    @bernym4047 ปีที่แล้ว

    I have jumped ahead early in this course and tried to use a for statement in the draw function with little success. I am beginning to understand the difficulties and found it much easier to use the if statement and managed to get the ball to bounce off each side by creating a variable that changed the increment of circeX from positive to negative (e.g. circleX = circleX + increment (increment changes from 1 to -1 alternatively)).
    I was a little impatient with this course at the beginning but now appreciate that its structure lends itself to transferring skills to other languages. Many thanks. I struggled with trying to teach myself programming for years but have made rapid progress with your course.

  • @ehsanullahakbari644
    @ehsanullahakbari644 ปีที่แล้ว

    first of all, thank you very much from these great videos
    this what I have learned from these series of videos till this point.
    // declaring variables
    float paintball;
    // setup making
    void setup() {
    size(800,400);
    paintball = 0;
    // background(50);
    }
    // drawing stuffs
    void draw() {
    background(50);
    fill(255,0,0);
    ellipse(paintball,200,30,30);
    paintball = paintball + 1;
    if (paintball>200) {
    background(255,0,0,127);
    fill(0,255,0);
    ellipse(paintball,200,30,30);
    }
    if (paintball>400) {
    background(0,255,0);
    fill(0,0,255);
    ellipse(paintball,200,30,30);}
    if (paintball>600) {
    background(0,0,255);
    ellipse(paintball,200,30,30);
    }
    if (paintball>=800) {paintball=0;
    }
    }

  • @juliansantos6466
    @juliansantos6466 8 ปีที่แล้ว +3

    thanks for your videos they are very helpful and extremely entertaining.

    • @TheCodingTrain
      @TheCodingTrain  8 ปีที่แล้ว

      +Julian Santos thanks for watching!

  • @miguelmaig
    @miguelmaig 5 ปีที่แล้ว

    thank you for all your videos!!

  • @wasiknoor3644
    @wasiknoor3644 ปีที่แล้ว

    great classes .Would recommend .Sir is very ....jumpy

  • @mitchellpincham595
    @mitchellpincham595 4 ปีที่แล้ว +1

    I wish that I found this series when I was trying to learn coding!

  • @konurozcan5731
    @konurozcan5731 8 ปีที่แล้ว +4

    your videos are great keep them up please, saving my grade in university !

    • @konurozcan5731
      @konurozcan5731 8 ปีที่แล้ว

      I actually do man ! any way we could hop on a quick private chat ?

    • @konurozcan5731
      @konurozcan5731 8 ปีที่แล้ว

      I messaged you on facebook !

  • @hummingmaths2763
    @hummingmaths2763 ปีที่แล้ว

    Your style of Teaching is Amazing
    Love & Respect from Pakistan 🇵🇰

  • @domcyber263
    @domcyber263 2 ปีที่แล้ว

    I love your work, and I also prefer the squeaky pen; something nostalgic about it. 10/10 more satisfying then non-squeaky pen

  • @mortezashayan5402
    @mortezashayan5402 4 ปีที่แล้ว

    Thank yo so much, this course is wonderful.

  • @sosobezhitashvili7896
    @sosobezhitashvili7896 8 ปีที่แล้ว +8

    float x=0;
    void setup () {
    size(640,360);
    }
    void draw () {
    background(255);
    fill(255,0,0);
    ellipse(x,180,30,30);
    x=x+1;
    if(x>width-1) {
    x=0;
    }
    }

    • @jlghfe36
      @jlghfe36 7 ปีที่แล้ว +1

      float ballX;
      float ballY;
      void setup() {
      size(700, 500);
      background(0);
      ballY = height/2;
      }
      void draw() {
      background(50);
      ellipse(ballX, ballY, 20, 20);
      println(ballX);
      ballX += 5;
      if (ballX >= width) {
      ballX = 0;
      }
      }

    • @nickrameau938
      @nickrameau938 7 ปีที่แล้ว

      float circleX, circleW, circleY;
      void setup() {
      size(630, 340);
      circleX = width / 2;
      circleY = height / 2;
      }
      void draw() {
      background(150);
      circleW = 24;
      fill(255);
      ellipse(circleX, circleY, circleW, circleW);
      circleX++;
      if (circleX + circleW > width + circleW / 2) {
      circleX = circleW / 2;
      }
      }

  • @queeniefcharles
    @queeniefcharles 3 ปีที่แล้ว

    YOU ARE AMAZING

  • @cybilisrani9062
    @cybilisrani9062 7 ปีที่แล้ว +1

    know my concept is clear thnx

  • @1rafaelespinoza
    @1rafaelespinoza 3 ปีที่แล้ว

    Tks. Daniel. Kool

  • @michaelrichards4302
    @michaelrichards4302 5 ปีที่แล้ว

    this is not my first language maybe my 5th or 6th or so (i'm a senior studying csc and they all kind of get blurred after a while) but this video series is one of the most consice video series that i have seen on a programming language so far

  • @bincyninan8719
    @bincyninan8719 4 ปีที่แล้ว

    Thank you for making vid like this would you make a machine learning vid too in processing

  • @AryehAmitz
    @AryehAmitz 8 ปีที่แล้ว +2

    Thanks for the videos once again. I'm just happy that I've been able to keep up. This is fun. I cant wait till i get much better; i know its a long ways to go... but I'm persistent.
    Can you do a tutorial on how to make programs into videos?

    • @TheCodingTrain
      @TheCodingTrain  8 ปีที่แล้ว +1

      +Indigo Veilplume yes, this is a good topic! I'll add to my list: gist.github.com/shiffman/b9ab475922f82e8112ff

    • @AryehAmitz
      @AryehAmitz 8 ปีที่แล้ว

      I figured out a way to do it with Adobe Premier and Aftereffects. Rendering with either would require some additional considerations that would probably be beyond the parameters of coding. It seems like everyone I've talked to uses ffmpeg- which isn't very user friendly for the beginner.
      I think that having a clearer pipeline from coding to sharability would improve the attractiveness of programming for individuals who are less savvy with the technical details. Maybe that's something i can lend a helping hand towards when i have improved my understanding of the toolkit.
      Thanks for your response. I look forward to the winter break so i can simmer with the text book.

  • @PaulCostanzaplaysdrums
    @PaulCostanzaplaysdrums 7 ปีที่แล้ว +1

    float circleX;
    void setup() {
    size(640,360);
    circleX = height/2;
    }
    void draw() {
    background(50);
    //Drawing stuff
    fill(255);
    stroke(255);
    ellipse(circleX,180,40,40);
    //Logic
    circleX += 3;
    if(circleX > 660) {
    circleX = -20;
    }
    }

  • @joaopedrofranco6987
    @joaopedrofranco6987 8 ปีที่แล้ว +1

    Nice video dude! ;)

  • @Pusciclark
    @Pusciclark 7 หลายเดือนก่อน

    Is it okay if the the ellipse from the practice you assigned at the end loops?

  • @joaikin
    @joaikin 3 ปีที่แล้ว

    Daniel...the name of the sign...is Lambda...and Antilambda. Greetings from Mexico

  • @aleksamitic8186
    @aleksamitic8186 6 ปีที่แล้ว +2

    float circleX = 2;
    void setup() {
    size(640, 360);
    }
    void draw() {
    background(50);
    fill(0, 0, 225);
    stroke(225, 0, 0);
    ellipse(circleX, 180, 24, 24);
    circleX = circleX + 1;
    if (circleX == width) {
    circleX = 640 - circleX;
    }
    }

    • @lydericmokoko115
      @lydericmokoko115 3 ปีที่แล้ว

      Thank you so much, you made my day !!!

  • @apprenticedtopicbookcritic101i
    @apprenticedtopicbookcritic101i ปีที่แล้ว

    Good Evening Danilel ☻

  • @leoming2292
    @leoming2292 4 ปีที่แล้ว

    Colors are fancy.

  • @soraboy93
    @soraboy93 8 ปีที่แล้ว +1

    Can I ask a question here? I'm currently working on a project that uses ReActivision
    and I've written a code that if I scan pattern A, I get video A
    if I scan pattern B, I get video B
    but if I scan pattern A and B at the same time, they both play simultaneously
    what I plan to do is scanning pattern A and B at the same time can result in playing a 3rd video
    in short, how should I implement statement that requires 2/multiple "true" checks (both id 1 and id 2 present at the same time) before it works?
    this one is for separate:
    if ( tobj.getSymbolID() == 1) {
    theMov.play();
    player1.play();
    println("Play");
    }
    if ( tobj.getSymbolID() == 2) {
    theMov2.play();
    player2.play();
    println("Play");
    }

    • @TheCodingTrain
      @TheCodingTrain  8 ปีที่แล้ว +2

      +Zero SSOX You can use an "AND", which is "&&"
      if (condition1 && condition2) { }
      This may be more complex based on your specific scenario, I would suggest asking this at forum.processing.org.

  • @User-in2mg
    @User-in2mg 7 ปีที่แล้ว

    void setup() {
    size(640, 360);
    }
    void draw() {
    background(50);
    fill (0, 255, 0);
    ellipse(mx, 180, 24, 24);
    mx = mx + 5;
    if (mx > 640) {
    mx = 1;
    }
    }

  • @muhammadahsin9513
    @muhammadahsin9513 ปีที่แล้ว

    U r so Cute AND Humorous, don't know WHY.....
    Love AND Respect from PAKISTAN.......

  • @raymondlumor875
    @raymondlumor875 4 ปีที่แล้ว

    Sir please, I need help on how to increase player scores

  • @Muslim_qui_doute
    @Muslim_qui_doute 3 ปีที่แล้ว

    Try this
    PVector loc;
    PVector vel;
    Void setup () {
    Size (100, 1000);
    loc = new PVector (width / 2, height / 2);
    vel = new PVector (4, 5);
    }
    Void draw () {
    Background (255);
    loc.add (vel);
    ellipse (loc.x, loc.y, 24, 24);
    if ((loc.x > width) || (loc.x < 0)) {
    vel.x *= -1;
    }else if ((loc.y > height) || (loc.y < 0)) {
    vel.y *= -1;
    }
    }

  • @alradaideh360
    @alradaideh360 5 ปีที่แล้ว

    i like the kind of weed u use !!

  • @pppo7910
    @pppo7910 4 ปีที่แล้ว

    respect

  • @MichaelGuy
    @MichaelGuy 9 หลายเดือนก่อน

    in node? java? perl? c? c++? node.js? python?

  • @renciapolous
    @renciapolous 3 ปีที่แล้ว

    If you need to program a rollover from scratch, you must first invent the universe. Or that's what Sagan would say. Sorry, I love you Daniel, thank you.

  • @Finestimpression29
    @Finestimpression29 2 ปีที่แล้ว

    there is more than one right answer? he isn't saying to make it bounce off the right side, correct? Just to make it restart on the left side?
    float circleX = 0;
    void setup(){
    size(640, 360);
    }
    void draw() {
    background(50);
    fill(255);
    ellipse(circleX,180,24,24);
    circleX = circleX + 5;
    if (circleX > 600) {
    circleX =20;
    }

    }

  • @hootpoop123
    @hootpoop123 6 ปีที่แล้ว +1

    I'm in a programming class and I was so close to throwing my computer until I found these videos. Thank you for making this 10x more simple for my dumbass mind to comprehend.

  • @tubex1300
    @tubex1300 5 ปีที่แล้ว

    More please make more vids please Sir

  • @brystet6642
    @brystet6642 5 ปีที่แล้ว +1

    i tried to make the ball bounce back but i failed miserably haha but instead i made the ball nervous and shake rapidly haha

  • @javegjajaja5604
    @javegjajaja5604 7 ปีที่แล้ว

    can you please help me, i need to write an if statement for my values.
    for example im doing my project i am controlling values through a sensor the values change based on how hard i blow the sensor now all i have to do is add a if statement that if the value goes over 15 for example then it should play this video if it does not move from 15 dont do anyhting please help me

  • @apprenticedtopicbookcritic101i
    @apprenticedtopicbookcritic101i ปีที่แล้ว

    Let's call it a day

  • @elorabimohamed3877
    @elorabimohamed3877 6 ปีที่แล้ว

    oh i'm crying it's sad moment

  • @ariacadabra
    @ariacadabra 7 ปีที่แล้ว +5

    them pesky squeaky pens...

  • @apprenticedtopicbookcritic101i
    @apprenticedtopicbookcritic101i ปีที่แล้ว

    Yeah I Found the section

  • @Ikpoppy
    @Ikpoppy 6 ปีที่แล้ว

    What about && and ||?

  • @zinx5598
    @zinx5598 2 ปีที่แล้ว +1

    parenthesis✅ brackets❌
    relational operators✅ data types❌
    hahaha

  • @nelsondelapena7840
    @nelsondelapena7840 3 ปีที่แล้ว

    if (circleX > width) {
    circleX = 0;
    }

    • @samfield4114
      @samfield4114 2 ปีที่แล้ว

      circleX = circleX + 1;

  • @zanealberts3829
    @zanealberts3829 4 ปีที่แล้ว +1

    Daniel

  • @spongefart9586
    @spongefart9586 ปีที่แล้ว

    God i love programming a idea litteraly a stupid dumb idea can be made with peoblem solving

  • @edwingarcia5043
    @edwingarcia5043 6 ปีที่แล้ว

    I had to put velocity video on 0.75

  • @paulgarrido8511
    @paulgarrido8511 2 ปีที่แล้ว

    Hi me. My name is Paul Garrido i'm from Perú, i hace a son in Toronto need your help because he start study Computer system binaria for computer tecnician

  • @OyesigyeDavin
    @OyesigyeDavin 7 ปีที่แล้ว

    I think 7 is greater than 7! but hey am not a computer.. HAHA!

  • @zayedabdulla123
    @zayedabdulla123 5 ปีที่แล้ว

    Didn't know el professor from la casa de papel did programming.

  • @giangtu5329
    @giangtu5329 4 ปีที่แล้ว

    I feel so sad for the circle :((

    • @jannikheidemann3805
      @jannikheidemann3805 4 ปีที่แล้ว

      I wrote a program that ends so that the circle can rest in peace:
      float circlePosX = 10;
      float circleDiam = 20;
      void setup() {
      size (640, 340);
      }
      void draw() {
      background(50);
      circle (circlePosX, 170, circleDiam);
      circlePosX++;
      if (circlePosX > width - (circleDiam * 0.5)) {
      circleDiam++;
      circlePosX = circleDiam * 0.5;
      if (circlePosX > width - (circleDiam * 0.5)) {
      finish();
      }
      }
      }
      void finish() {
      delay(5000);
      exit();
      }

  • @colloidalsilver177
    @colloidalsilver177 6 ปีที่แล้ว

    Is this js

  • @capturedevice62
    @capturedevice62 2 ปีที่แล้ว

    His hands move way too much