NO

Author Topic: Console Char Table  (Read 2325 times)

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1881
Console Char Table
« on: April 02, 2012, 12:33:56 pm »
Print char table to console
If you copy that to bitmap and negative picture, it is printable.
See attachment.

Code: [Select]
// ConCharTbl.c
#include <stdio.h>

char print_chr(int c)
{
//if (c == 7 || c == 8 || c == 9 || c == 10 || c ==  13) return ' ';
if (c  >= 7 && c <= 13) return ' ';
return c;
}

int main(int argc, char **argv)
{
int i,k;
for (int j = 0; j < 8; j++) {
if (j < 3) printf(" \332\304\304\302\304\304\302\304\277");
else printf(" \332\304\304\304\302\304\304\302\304\277");
}
printf("\n");

for (int i = 0; i < 32; i++) {
printf(" \263%2d\263%2X\263%c\263",i,i,print_chr(i));
for (int j = 1; j < 8; j++) {
k = j * 32 + i;
if (j < 3) printf(" \263%2d\263%2X\263%c\263",k,k,k);
else printf(" \263%3d\263%2X\263%c\263",k,k,k);
}
printf("\n");
}
for (int j = 0; j < 8; j++) {
if (j < 3) printf(" \300\304\304\301\304\304\301\304\331");
else printf(" \300\304\304\304\301\304\304\301\304\331");
}
printf("\n");
return 0;
}
May the source be with you

CommonTater

  • Guest
Re: Console Char Table
« Reply #1 on: April 03, 2012, 07:01:14 am »
Handy!  Thank you.