new version of grace

This commit is contained in:
asus
2024-01-25 14:12:49 +01:00
parent 1dea608c0d
commit 2e0b5dd8d9
3 changed files with 13 additions and 20 deletions

View File

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