1
0
forked from M-Labs/nac3
nac3/nac3standalone/demo/demo.c

31 lines
466 B
C
Raw Normal View History

2020-03-30 22:47:45 +08:00
#include <stdio.h>
#include <string.h>
2021-12-13 11:18:44 +08:00
void output_int32(int x) {
2021-09-22 14:30:52 +08:00
printf("%d\n", x);
}
2021-12-13 11:18:44 +08:00
void output_int64(long x) {
2021-12-13 04:06:38 +08:00
printf("%ld\n", x);
}
2021-09-22 14:30:52 +08:00
void output_asciiart(int x) {
2020-03-30 22:47:45 +08:00
static char chars[] = " .,-:;i+hHM$*#@ ";
if(x < 0) {
putchar('\n');
} else {
if(x < strlen(chars)) {
2021-09-22 14:30:52 +08:00
putchar(chars[x]);
2020-03-30 22:47:45 +08:00
} else {
2021-09-22 14:30:52 +08:00
printf("ERROR\n");
2020-03-30 22:47:45 +08:00
}
}
}
extern int run();
int main() {
run();
return 0;
}