I'm not entirely sure about this line of code, its from the original gl quake's source code. Carmack does a lot of funny things at the bit level and I have no friggin clue what they are supposed to be
the actual part of this is the
rand()&3) & 1
the entire context is this:
any clue what the bitwise and operator is being used for? If i remember correctly if bit A and bit B are 1, then the resulting bit is also a 1, otherwise its a zero if either are 0?
Oh and this is actually monster code, I guess it randomly chooses a dijrection to move in somehow?
if ( ((rand()&3) & 1) || abs(deltay)>abs(deltax))
Thanks if you can help explain this to me
EDIT: is doing operations on variables faster on the bit level?