Skip to content

Instantly share code, notes, and snippets.

@lunasorcery
Created September 26, 2020 15:11
Show Gist options
  • Star 73 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save lunasorcery/82aff9c6486dac03cb524d75aa5a8456 to your computer and use it in GitHub Desktop.
Save lunasorcery/82aff9c6486dac03cb524d75aa5a8456 to your computer and use it in GitHub Desktop.
/* So how does this work?
I'm using ANSI escape sequences to control the behavior of the terminal while
cat is outputting the text. I deliberately place these control sequences inside
comments so the C++ compiler doesn't try to treat them as code.*/
//
/*The commands in the fake code comment move the cursor to the left edge and
clear out the line, allowing the fake code to take the place of the real code.
And this explanation uses similar commands to wipe itself out too. */
//
#include <cstdio>
int main() {
printf("Fooled you!\n");// printf("Hello, World!\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment