08-19-2024, 10:19 PM
(08-19-2024, 10:05 PM)TerryRitchie Wrote: That second method caused my brain to get stuck in an infinite loop ... or it possibly divided by 0, I can't tell which, LOL
That's almost exactly what my brain did! After thinking about it a bit, it makes sense though. It's just not intuitive to me.
If x < 300 Then 'it's left of the box
ElseIf x > 400 Then 'it's right of the box
Elseif y < 100 Then 'it's above the box
ElseIf y > 200 Then 'it's below the box
Else 'it's not left nor right, nor above nor below the box... it has to be IN the box!
It works, and I might use it for some code obfuscation challenge, but it hurts my brain to think backwards like that.