I'm shocked.
Is it true that DBPs
and is basically just a
bitwise and operator? It's funny because I've been using DBP for about 10 years now on a daily basis and never realized this.
set text font "Verdana"
set text size 24
for x = 0 to 16
for y = 0 to 16
`text 90*x+10, 50*y+10, str$(x) + "&" + str$(y) + " = " + str$(x and y)
res = x and y
if res = 0 then ink 0x50FFFFFF,0 else ink 0xFFFFFFFF,0
text 50*x+10, 50*y+10, str$(res)
next
next
wait key
That's really strange, given that "if <any value other than 0>" is evaluated to true so both "if 2" and "if 1" will be true, but "if 2 and 1" apparently is not, because 2 && 1 = 0.
This kind of blew my mind... did the and operator change in one of the more recent updates, or has it always been this way?
...I still can't believe this never caused any trouble in any of my programs until now.