grace works, without comments for now

This commit is contained in:
asus
2024-01-24 09:38:43 +01:00
parent cb2683144e
commit 8cfd86bc90
2 changed files with 6 additions and 2 deletions

View File

@@ -1,7 +1,8 @@
#include <stdio.h>
#define PRINT quine, 10, 10, 92, 10, 34, quine, 34, 92, 10, 92, 10, 92, 10, 10, 10, 10, 10
#define PRINT quine, 10, print, 10, 92, 10, 92, 10, 34, quine, 34, 92, 10, 92, 10, 92, 10, 10, 10, 10, 10
#define FT(...) int main(){\
char *quine = "#include <stdio.h>%c#define PRINT "#__VA_ARGS__" %c#define FT(...) int main(){%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";\
char *print = #__VA_ARGS__;\
char *quine = "#include <stdio.h>%c#define PRINT %s%c#define FT(...) int main(){%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;\
}

View File

@@ -1 +1,4 @@
- [interactions between MACRO and comments](https://gcc.gnu.org/onlinedocs/cpp/Stringizing.html#:~:text=the%20stringized%20result.-,Comments,-are%20replaced%20by)
- [preprocessor strip comments before exapnding macros](https://stackoverflow.com/questions/1510869/does-the-c-preprocessor-strip-comments-or-expand-macros-first)
- [create an include with a macro OR NOT](https://stackoverflow.com/questions/1135822/escaping-a-symbol-in-a-define-macro)