Skip to content

Instantly share code, notes, and snippets.

@thomasdarimont
Created December 2, 2021 17:47
Show Gist options
  • Save thomasdarimont/670964bfd6705c4121c07c80f92264e2 to your computer and use it in GitHub Desktop.
Save thomasdarimont/670964bfd6705c4121c07c80f92264e2 to your computer and use it in GitHub Desktop.
Simple JShell Quine
$ echo 'var s="var s=%1$s%2$s%1$s;printf(s,(char)34,s);/exit";printf(s,(char)34,s);/exit' > quine.jshell
$ cat quine.jshell 
var s="var s=%1$s%2$s%1$s;printf(s,(char)34,s);/exit";printf(s,(char)34,s);/exit
$ jshell PRINTING --feedback concise quine.jshell
var s="var s=%1$s%2$s%1$s;printf(s,(char)34,s);/exit";printf(s,(char)34,s);/exit
var s=%1$s%2$s%1$s;printf(s,(char)34,s);/exit";printf(s,(char)34,s);/exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment