// specific for 8 by 12 #include #include typedef unsigned char uc; typedef long long int b; int main(){ // -1 0 1 2 3 4 5 6 7 8 // 1 1 2 3 5 8 13 21 34 55 uc pats[55]; {int j = 256, x = 0; while (j--) if(!(j & (j<<1))) pats[x++] = j; if (x != 55) {printf("zilch %d\n", x); exit (3);}} {b old[55], new[55]; int hight=12-1; {int j=55; while(j--) old[j] = 1;} while (hight--) {int k = 55; {int n = 55; while(n--) new[n] = 0;} while(k--) {int n = 55; while(n--) if(!(pats[n] & pats[k])) new[n] += old[k];} {int n = 55; while(n--) old[n] = new[n];}} {int j=55; while(j--) printf("%21lld %02X\n", old[j], pats[j]);} {int j=55; b s = 0; while(j--) s += old[j]; printf("All together %lld 11 by 8 patterns\n", s);} }} /* Yields: 14279081380626859 00 9791504655866770 01 10940702696975894 02 10587835540201631 04 7648880146402225 05 10697880167724359 08 7184616557758678 09 8515163149617347 0A 10697880167724359 10 7395907637591593 11 8074723808680807 12 8269734536157610 14 5985991502888929 15 10587835540201631 20 7235188626524967 21 8162239797325917 22 7717866744406768 24 5569600379002598 25 8269734536157610 28 5548065932740362 29 6591821912552521 2A 10940702696975894 40 7512142007547246 41 8363702710355094 42 8162239797325917 44 5899181554535043 45 8074723808680807 48 5425694945704773 49 6422817805692677 4A 8515163149617347 50 5889440883245825 51 6422817805692677 52 6591821912552521 54 4772545976067470 55 9791504655866770 80 6709121213954542 81 7512142007547246 82 7235188626524967 84 5225388190696769 85 7395907637591593 88 4965418198886759 89 5889440883245825 8A 7184616557758678 90 4965418198886759 91 5425694945704773 92 5548065932740362 94 4015212282051093 95 7648880146402225 A0 5225388190696769 A1 5899181554535043 A2 5569600379002598 A4 4018733317710892 A5 5985991502888929 A8 4015212282051093 A9 4772545976067470 AA All together 397743903151933881 11 by 8 patterns */