This is a github-based game for people at the Recurse Center.
Quines are programs that -- if you run them -- output a string that is equal to their source code. It's a fun puzzle to figure out how to write a quine, so we won't give any hints in this README. Also, beware of spoilers when browsing this repo, which will contain lots of quines, or when googling quines.
If you want to play this game, just submit a PR to this repo that contains a quine, in a language of your choice. CI will check whether the program you've submitted is actually a quine. If CI passes, you have won the game. (Yay!)
Also, you can ping us in a github comment @soenkehahn and we will merge the PR. This way, we hope that this repo will become a fun collection of interesting and creative quines.
Fork this repo. Then, the workflow depends on whether you submit code for an interpreted language like Python or Ruby or a compiled language like C.
Create a PR that adds a new directory to this repo that
contains one file called quine
. That file has to be executable
(chmod +x ./quine
) and it'll be
executed without specifying an interpreter, so it should probably include
a shebang. A shebang is a line at the beginning of your script that tells your shell
which interpreter to run. For example, to submit a python quine, add a shebang at
the beginning like so:
#!/usr/bin/env python
More information about shebangs here.
Here's an example of such a PR (that is not a quine, to avoid spoilers.)
Create a PR that adds a new directory to this repo that
contains one file called quine.ext
, where ext
is the appropriate
file extension for the language you're submitting. See the supported
languages.
After submitting
a PR, you can monitor CI to see the quine-checker
checking your PR. Here's a link:
https://circleci.com/gh/soenkehahn/rc-quines
The quine-checker is implemented here. You can install it to check your quines locally. But you don't have to use it, you can also just rely on CI.
People sometimes argue about what is a valid quine and what is not. For example, reading from the file system is sometimes considered to be cheating.
We disagree and think it's a lot of fun to figure out how to cheat in creative ways.
If you can fool the automated quine-checker
on CI, we'll consider your program a quine
and merge the PR. So, feel free to cheat.
We won't merge PRs that do 'extreme cheating' such as messing with other people's quines
or with the quine-checker
, because that would break the game for others. However, we still
look forward to receiving PRs like that.
Currently the supported interpreted languages are:
- bash
- python
- javascript (through
node
) - haskell (through ghc's
runhaskell
) - ruby
- R (via
Rscript
)
and the supported compiled languages are:
- C , must use
.c
extension (viagcc
) - rust , must use
.rs
extension (viarustc
) - go , must use
.go
extension (viago build
)
We will add more languages quickly depending on interest. If your favourite
language is not yet supported, feel free still to create a PR. We will try
to add support for that language. Alternatively, we very much welcome PRs for
the quine-checker
itself
adding support for more languages.