Generating the look - up table while pre - processing
< ? php #define P2 ( n )  n, n ^ 1, n ^ 1, n NEW_LINE #define P4 ( n )  P2(n), P2(n ^ 1),  NEW_LINE P2 ( n ^ 1 ) , P2 ( n ) #define P6 ( n )  P4(n), P4(n ^ 1),  NEW_LINE P4 ( n ^ 1 ) , P4 ( n ) #define LOOK_UP  P6(0), P6(1),  NEW_LINE P6 ( 1 ) , P6 ( 0 )