#include #include #include /* Sol LeWitt's "Open Cubes" sequence: 1, 3, 123, ... Counts the number of ways to remove 0 or more edges of an n-cube such that remaining edges are connected and span all n dimensions. An alternate sequence considers reflections equivalent: 1, 3, 78, ... This program generates the 123 (and 78) solutions for n=3 Bit Encoding... BIT 0 1 2 3 4 5 6 7 8 9 10 11 ------------------------------- V0 0 0 0 1 1 2 2 3 4 4 5 6 V1 1 2 4 3 5 3 6 7 5 6 7 7 x - - - - x - - x - - x X_mask = 0x921 - y - y - - - - - y y - Y_mask = 0x60a - - z - z - z z - - - - Z_mask = 0x0d4 Written by Andrew Weimholt - Feb 12, 2013 */ #define MAXV 8 #define MAXE 12 // static int X = 0x921; static int Y = 0x60a; static int Z = 0x0d4; // static int v0[MAXE] = {0,0,0,1,1,2,2,3,4,4,5,6}; static int v1[MAXE] = {1,2,4,3,5,3,6,7,5,6,7,7}; // static int e[MAXV][MAXV]; void init_e(){int i=0;for(int b=0;b