PHP Code:
//Param 1 = the bitsum\variable
//Param 2 = the bit to manipulate
#define SetBit(%1,%2) ( %1 |= ( 1 << (%2) ) )
#define ClearBit(%1,%2) ( %1 &= ~( 1 << (%2) ) )
#define CheckBit(%1,%2) ( %1 & ( 1 << (%2) ) )
iRandBit = random_num( 0 , 2 )
if ( CheckBit( bitsum , iRandBit ) )
{
//bit set
}
__________________