2017-04-16 03:24:44 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2017-04-16 03:55:14 +00:00
|
|
|
int i, j, k, linemap[24];
|
2017-04-16 03:58:58 +00:00
|
|
|
char screen[24][40];
|
2017-04-16 03:24:44 +00:00
|
|
|
|
|
|
|
// build table
|
2017-04-16 16:38:06 +00:00
|
|
|
for (j = 0, i = 0; i < 8; i++, j++) {
|
|
|
|
linemap[0 + 3 * j] = j;
|
|
|
|
linemap[1 + 3 * j] = j + 8;
|
|
|
|
linemap[2 + 3 * j] = j + 16;
|
2017-04-16 03:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// clear screen
|
2017-04-16 16:38:06 +00:00
|
|
|
for (i = 0; i < 24; i++)
|
|
|
|
for (j = 0; j < 40; j++)
|
2017-04-16 03:24:44 +00:00
|
|
|
screen[linemap[i]][j] = ' ';
|
|
|
|
|
2017-04-16 16:38:06 +00:00
|
|
|
for (i = 0; i < 24; i++) {
|
|
|
|
for (j = 0; j < 40; j++)
|
2017-04-16 03:56:58 +00:00
|
|
|
screen[linemap[i]][j] = getchar() & 0x7F;
|
2017-04-16 16:38:06 +00:00
|
|
|
if ((i + 1) % 3 == 0)
|
|
|
|
for (k = 0; k < 8; k++)
|
2017-04-16 03:56:58 +00:00
|
|
|
getchar();
|
2017-04-16 03:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// dump to stdout
|
2017-04-16 16:38:06 +00:00
|
|
|
for (i = 0; i < 24; i++) {
|
|
|
|
for (j = 0; j < 40; j++)
|
2017-04-16 03:24:44 +00:00
|
|
|
putchar(screen[i][j]);
|
|
|
|
printf("\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|