07-03-2003, 11:32 PM
In the Challenge topic re Recursion, we also saw the following use of XOR.
Code:
REM Generate Gray Code bytes; i.e. values in range from 0 to 255.
DEFINT A-Z
FOR X=0 TO 255
GRAY = X XOR (INT(X/2))
rem Print or output the Gray Code value in GRAY.
NEXT X