1df0d98c30be84d6e7e3318903c2d23fe7bda558
[mopice.git] / greetings.c
1 #include <stdio.h>
2
3 int main_old() {
4     int ret;
5     char val;
6     char *pos = "                                                                                                                                  *";
7     while ((ret = read(0, &val, 1)) > 0) {
8         // printf("%d\n", 64 + (val / 2));
9         printf("%s\n", &(pos[64+(val / 2)]));
10         fflush(stdout);
11     }
12     
13 }
14
15 int main() {
16     int ret, ival;
17     char val;
18     char *pos = "                                                                                                                                  *";
19     while ((ret = read(0, &val, 1)) > 0) {
20         val = val >> 1;
21         // fprintf(stdout, "%d\n", *(signed char *)(&ival));
22         // val = *(signed char *)(&ival);
23         // fprintf(stdout, "%s\n", &(pos[64+(val/2)]));
24         write(2,&val,1);
25         // fflush(stdout);
26     }
27     
28 }