added sed command in makefile to concat quine

This commit is contained in:
asus
2024-01-25 18:40:37 +01:00
parent 805f3b695f
commit 65aac2c25a
4 changed files with 60 additions and 24 deletions

View File

@@ -1,14 +1,8 @@
#include <stdio.h>
#define PRINT quine, 10, print, 10, 92, 10, 92, 10, 92, 10, 92, 10, 92, 10, 34, quine, 34, 92, 10, 92, 10, 92, 10, 10, 10, 10, 10
#define FT(...) int main(){\
/*\
comment\
*/\
char *print = #__VA_ARGS__;\
char *quine = "#include <stdio.h>%c#define PRINT %s%c#define FT(...) int main(){%c%c /*%c%c comment%c%c */%c%c char *print = #__VA_ARGS__;%c%c char *quine = %c%s%c;%c%c printf(PRINT);%c%c return 0;%c%c}%c#define FFT(...) FT(__VA_ARGS__)%c%cFFT(PRINT)%c";\
printf(PRINT);\
return 0;\
}
#define FFT(...) FT(__VA_ARGS__)
FFT(PRINT)
#define xstr(s) #s
#define str(s) xstr(s)
#define MAIN(s) int main() { char *quine = "#include <stdio.h>\n#define xstr(s) #s\n#define str(s) xstr(s)\n#define MAIN(s) "s"\n/*\n comment\n*/\nMAIN(str(MAIN(s)))\n"; FILE *file = fopen("Grace_kid.c", "w"); fprintf(file, "%s", quine); return 0; }
/*
comment
*/
MAIN(str(MAIN(s)))