treesummaryrefslogcommitdiff
path: root/printself.c
blob: dd5f0e1776b8530025feefda1536e088d766784b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// cc printself.c -o printself && diff <(./printself) printself.c
#include <stdio.h>
int main() {
    const char *f = (const char[]){32,32,32,32,32,32,32,32,34,37,115,34,44,10,0};
    const char **s = (const char*[]) {
        "// cc printself.c -o printself && diff <(./printself) printself.c",
        "#include <stdio.h>",
        "int main() {",
        "    const char *f = (const char[]){32,32,32,32,32,32,32,32,34,37,115,34,44,10,0};",
        "    const char **s = (const char*[]) {",
        "    };",
        "    for (int i = 0; i <= 4; i++)",
        "        puts(s[i]);",
        "    for (int i = 0; i <= 13; i++)",
        "        printf(f, s[i]);",
        "    for (int i = 5; i <= 13; i++)",
        "        puts(s[i]);",
        "    return 0;",
        "}",
    };
    for (int i = 0; i <= 4; i++)
        puts(s[i]);
    for (int i = 0; i <= 13; i++)
        printf(f, s[i]);
    for (int i = 5; i <= 13; i++)
        puts(s[i]);
    return 0;
}