How is mod % used in programming? Answering student questions!

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ต.ค. 2024

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

  • @paulramasco6769
    @paulramasco6769 6 วันที่ผ่านมา +1

    Very awesome video. One area where I've used mod a lot in various areas is when trying to find some angle offset. I used to work for a test and evaluation command so I would place sensors off the line of fire. Before I learned about transforms I could calulate the distance and position of a sensor using standard geometry. So if I wanted to know the x and y position of a sensor, using the local coordinate system, it would be something like X_desired = distance * (cosine(90-line of fire) mod 360))+X_current, Y_desired = distance * (sine(90-line of fire) mod 360))+Y_current.

    • @DesignCodeDebugRepeat
      @DesignCodeDebugRepeat  6 วันที่ผ่านมา

      Very cool!! Thank you for the real-world example! I'd describe your use case as constraining your result to within 360 degrees, do I understand you correctly? Thank you for the comment! 😁

  • @anthonydrakefordshadow
    @anthonydrakefordshadow 5 วันที่ผ่านมา +1

    Hello Maggie ❤

    • @DesignCodeDebugRepeat
      @DesignCodeDebugRepeat  4 วันที่ผ่านมา

      Hello 😊

    • @anthonydrakefordshadow
      @anthonydrakefordshadow วันที่ผ่านมา +1

      @@DesignCodeDebugRepeat FINALLY have the time to sit back and watch this, thank you for the content 🤗

    • @DesignCodeDebugRepeat
      @DesignCodeDebugRepeat  วันที่ผ่านมา +1

      @@anthonydrakefordshadow Life is busy! The videos aren't going anywhere. 😊 Enjoy!! 🙃

    • @anthonydrakefordshadow
      @anthonydrakefordshadow วันที่ผ่านมา

      @@DesignCodeDebugRepeat​​⁠ I really liked all of the suggested uses like the timed gate and energy meter but I especially would like to see the walking animation reference connected to the keydown events if you do not already have a video for it 😇

    • @DesignCodeDebugRepeat
      @DesignCodeDebugRepeat  วันที่ผ่านมา +1

      @@anthonydrakefordshadow Hi Anthony! So I'm sorry, because you may have mentioned this before -- how exactly do you want to see the walking animation related to keydown events? I'm sure I could provide code and an explanation for that if I don't have a video like that. I think I do have videos where the character motion is controlled with the arrow keys, if that's what you're looking for. I'm not sure if that's the focus of the video. But tell me what you're interested in and I'll look.