Skip to content

lbalvarenga/jsf-quine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JSF*** Quine

(()=>{})[(({}+[])[+!![]+ +!![]+ +!![]+ +!![]+ +!![]]+({}+[])[+!![]]+([][+![]]+[])[+!![]]+(![]+[])[+!![]+ +!![]+ +!![]]+(!![]+[])[+![]]+(!![]+[])[+!![]]+(!![]+[])[+!!
[]+ +!![]]+({}+[])[+!![]+ +!![]+ +!![]+ +!![]+ +!![]]+(!![]+[])[+![]]+({}+[])[+!![]]+(!![]+[])[+!![]])]((([]+[])[(({}+[])[+!![]+ +!![]+ +!![]+ +!![]+ +!![]]+({}+[])
[+!![]]+([][+![]]+[])[+!![]]+(![]+[])[+!![]+ +!![]+ +!![]]+(!![]+[])[+![]]+(!![]+[])[+!![]]+(!![]+[])[+!![]+ +!![]]+({}+[])[+!![]+ +!![]+ +!![]+ +!![]+ +!![]]+(!![]+
[])[+![]]+({}+[])[+!![]]+(!![]+[])[+!![]])][((![]+[])[+![]]+(!![]+[])[+!![]]+({}+[])[+!![]]+((+![])[(({}+[])[+!![]+ +!![]+ +!![]+ +!![]+ +!![]]+({}+[])[+!![]]+([][+!
[]]+[])[+!![]]+(![]+[])[+!![]+ +!![]+ +!![]]+(!![]+[])[+![]]+(!![]+[])[+!![]]+(!![]+[])[+!![]+ +!![]]+({}+[])[+!![]+ +!![]+ +!![]+ +!![]+ +!![]]+(!![]+[])[+![]]+({}+
[])[+!![]]+(!![]+[])[+!![]])]+[])[+!![]+ +!![]+ +!![]+ +!![]+ +!![]+ +!![]+ +!![]+ +!![]+ +!![]+ +!![]+ +!![]]+(()=>{})[(({}+[])[+!![]+ +!![]+ +!![]+ +!![]+ +!![]]+
({}+[])[+!![]]+([][+![]]+[])[+!![]]+(![]+[])[+!![]+ +!![]+ +!![]]+(!![]+[])[+![]]+(!![]+[])[+!![]]+(!![]+[])[+!![]+ +!![]]+({}+[])[+!![]+ +!![]+ +!![]+ +!![]+ +!![]]+
(!![]+[])[+![]]+({}+[])[+!![]]+(!![]+[])[+!![]])](((!![]+[])[+!![]]+(![]+[])[+!![]+ +!![]+ +!![]+ +!![]]+(!![]+[])[+![]]+(!![]+[])[+!![]+ +!![]]+(!![]+[])[+!![]]+([]
[+![]]+[])[+!![]]+({}+[])[+!![]+ +!![]+ +!![]+ +!![]+ +!![]+ +!![]+ +!![]]+(![]+[])[+!![]+ +!![]+ +!![]+ +!![]]+(![]+[])[+!![]+ +!![]+ +!![]]+({}+[])[+!![]+ +!![]+ +!!
[]+ +!![]+ +!![]]+(![]+[])[+!![]]+(/-/[(({}+[])[+!![]+ +!![]+ +!![]+ +!![]+ +!![]]+({}+[])[+!![]]+([][+![]]+[])[+!![]]+(![]+[])[+!![]+ +!![]+ +!![]]+(!![]+[])[+![] ...

A 966-byte JavaScript quine generator that produces a valid self-replicating file that utilizes only 8 different characters.

Inspiration

All credit goes to the owner of the channel Low Level Javascript. This is based on a video of his, titled JavaScript Is Weird (EXTREME EDITION)

Running the script (producing the quine)

Due to some character encoding problems, this is known to produce faulty programs on Windows 11 with Node version 16.14.2. On Ubuntu with Node version 10.19.0, however, correct output is produced.

Be warned that the generated file exceeds 3MB.

node quinegen.js > quine0.js

Producing a self-similar script

node quine0.js > quine1.js

Verifying the files are identical

On most *nix systems, the output of the following should be blank:

diff -q quine0.js quine1.js

About the repository

alpha/ contains testing scripts that should be more readable than quinegen.js.

Considerations

Although the quine could be much smaller, it is Turing complete and can produce any valid program by modifying the original generator.