blob: 58702a8d6cc6877337cb3753336a0cbf11d512b2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <unistd.h>
int main(int argc,char *argv[]) {
int i,j,k;
int height=argc>1?atoi(argv[1]):8;
char *map=malloc(height);
for(i=0;i<256;i++) {
printf("0x%02x (%3d) '%c'\n",i,i,isprint(i)?i:'?');
read(0,map,height);
for(j=0;j<height;j++) {
for(k=7;k>=0;k--) {
printf("%c",(map[j]>>k&1)?'#':'.');
}
printf("\n");
}
}
return 0;
}
|