Skip to content

jin-park/Quine.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quine

Prints out a quine with n variables

Installation

Go into the Julia REPL, and press ] to go into pkg mode

(@v1.5) pkg> add https://github.com/jin-park/Quine.jl.git
julia> using Quine

Examples

julia> using Quine

julia> generate_quine(3)
c = :(println("c = :(" * string(c) * ")\nb = :(eval(c); println(\"a = :(eval(b))\\neval(a)\"))"))
b = :(eval(c); println("a = :(eval(b))\neval(a)"))
a = :(eval(b))
eval(a)

julia> generate_quine(5)
e = :(println("e = :(" * string(e) * ")\nd = :(eval(e); println(\"c = :(eval(d); println(\\\"b = :(eval(c); println(\\\\\\\"a = :(eval(b))\\\\\\\\neval(a)\\\\\\\"))\\\"))\"))"))
d = :(eval(e); println("c = :(eval(d); println(\"b = :(eval(c); println(\\\"a = :(eval(b))\\\\neval(a)\\\"))\"))"))
c = :(eval(d); println("b = :(eval(c); println(\"a = :(eval(b))\\neval(a)\"))"))
b = :(eval(c); println("a = :(eval(b))\neval(a)"))
a = :(eval(b))
eval(a)

Well why should I care?

Definition of a quine from wikipedia: A quine is a computer program which takes no input and produces a copy of its own source code as its only output. If that isn't the coolest thing ever then I don't know what is.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages