3 ms·
Code on screen at https://youtu.be/htk6eXxpSNA?t=23 https://youtu.be/htk6eXxpSNA?t=23 `if y < prevValue or prevValue is None:` should be `if prevValue is Non
by qwertox 6y ago
Code on screen at https://youtu.be/htk6eXxpSNA?t=23 https://youtu.be/htk6eXxpSNA?t=23
`if y < prevValue or prevValue is None:`
should be
`if prevValue is None or y < prevValue:`
because the first one will make a comparison for `y < None`, while the second one won't. `y < None` will always return `False` while `prevValue is None` will then always return `True`, making the entire statement `True` if `prevValue` is `None`.
It is not a bug but it's something which I would correct. In the second one `y < prevValue` would not get evaluated if `prevValue` is `None` and it's not really clear what `y < None` means.
--
Great work which reminded me of the Ace of Spades-Robots. It also shows how insanely good humans can be at playing guitars.
- nik12795 6y agoAppreciate you looking through the code and offering that suggestion. I'll take a closer look ;) Also was not aware of the Ace of Spades robots. Just watched the video and it's epic!
- Yajirobe 6y agothat's a condescending comment
- qwertox 6y agoMy apologies to nik12795 if he felt that way, it certainly wasn't meant to be condescending at all. It's really impressive what he archived there, not only the image recognition, considering the high speed of certain parts of the video, but also the hardware implementation. It was my mistake to only focus so much on the code-thing. Thanks for pointing it out.