Skip to content

Instantly share code, notes, and snippets.

@apaz-cli
Created June 11, 2022 21:03
Show Gist options
  • Select an option

  • Save apaz-cli/22d8d9087aecc26e1717f1b32dc15289 to your computer and use it in GitHub Desktop.

Select an option

Save apaz-cli/22d8d9087aecc26e1717f1b32dc15289 to your computer and use it in GitHub Desktop.
#include <limits.h>
#include <stdio.h>
#define EN "\x1b[36m"
#define BX "\x1b[31m"
#define RS "\x1b[0m"
#define LT "\x1b[33m"
int main(void) {
puts(BX "======================== ASCII TABLE ========================");
for (char i = 32;; i++) {
char v[2];
v[0] = i;
v[1] = '\0';
printf(BX "|" RS " " EN "%3d" RS " " EN "-" RS " " LT "%s" RS " ", i, v);
if (i == CHAR_MAX) {
puts(RS " " BX "|");
break;
}
if (i % 6 == 1) {
puts(BX "|");
}
}
putchar('\n');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment