Skip to content

Instantly share code, notes, and snippets.

@nocturnalact
Created December 5, 2013 15:15
Show Gist options
  • Save nocturnalact/7807008 to your computer and use it in GitHub Desktop.
Save nocturnalact/7807008 to your computer and use it in GitHub Desktop.
/** my sample quine code**/ #include <stdio.h>
static char quine[] = "\n\t\\\"";
int main(void) {
const char *code = "/** my sample quine code**/ #include <stdio.h>%c%cstatic char quine[] = %c%cn%ct%c%c%c%c%c;%c%cint main(void) {%c%cconst char *code = %c%s%c;%c%cprintf(code, quine[0], quine[0], quine[3], quine[2], quine[2], quine[2], quine[2], quine[2], quine[3], quine[3], quine[0], quine[0], quine[0], quine[1], quine[3], code, quine[3], quine[0], quine[1], quine[0], quine[0], quine[1], quine[0], quine[0]);%c%c%creturn 0;%c}%c";
printf(code, quine[0], quine[0], quine[3], quine[2], quine[2], quine[2], quine[2], quine[2], quine[3], quine[3], quine[0], quine[0], quine[0], quine[1], quine[3], code, quine[3], quine[0], quine[1], quine[0], quine[0], quine[1], quine[0], quine[0]);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment