dos33fsprogs/graphics/hgr/snowflake/blah.c
2021-01-25 15:28:49 -05:00

48 lines
980 B
C

#include <stdio.h>
char data[12*6]={
0x00,0x00,0x40,0x01,0x00,0x00,
0x00,0x00,0x0C,0x18,0x00,0x00,
0x00,0x00,0x70,0x07,0x00,0x00,
0x00,0x00,0x43,0x61,0x00,0x00,
0x00,0x00,0x4C,0x19,0x00,0x00,
0x33,0x00,0x70,0x07,0x00,0x66,
0x30,0x06,0x40,0x01,0x30,0x06,
0x3f,0x06,0x40,0x01,0x30,0x7e,
0x40,0x07,0x30,0x06,0x70,0x01,
0x7c,0x07,0x30,0x06,0x70,0x1f,
0x00,0x18,0x0F,0x78,0x0C,0x00,
0x00,0x60,0x40,0x01,0x03,0x00,
};
int main(int argc, char **argv) {
int i,j,k,b,n,total=0,min=72;
for(k=0;k<255;k++) {
for(j=0;j<255;j++) {
total=0;
for(i=0;i<12*6;i++) {
b=data[i];
n=b;
n=n>>j;
n=n^k;
// n=n/2;
// if ((n<0x20) || (n>0x5f)) {
if ((n<0x20) || (n>0x7e)) {
// printf("%x %x out of range\n",b,n);
total++;
}
}
printf("%d,%d: Total %d / %d\n",j,k,total,12*6);
if (total<min) min=total;
}
}
printf("Min=%d\n",min);
return 0;
}