RockstarLang / rockstar

Home of the Rockstar programming language
https://codewithrockstar.com/
GNU Affero General Public License v3.0
6.88k stars 223 forks source link

Quines #338

Open dylanbeattie opened 5 months ago

dylanbeattie commented 5 months ago

So here's an idea:

The Rockstar interpreter will accept ANY source code file containing the word "quine", and will print the entire source code.

That's it. So if you want to use it in something like the ouroboros quine... easy.

caseyc37 commented 5 months ago

Might I suggest that this be as a full word only? I'd rather not have the full code printed just because I included the word "equine" as a variable name

dylanbeattie commented 5 months ago

That's a good call - agreed that it shouldn't be triggered by "equine".

Now I think about it... what if the activation keyword was quïne with a mëtäl ümläüt over the i? That'll produce the same behaviour, but much less risk of accidentally quining your program because you said your lead singer's harlequinery wouldn't work without his sequined underwear.

If anybody's curious, the colliding words are:

  1. basquine
  2. broquineer
  3. chloroquine
  4. equine
  5. equinecessary
  6. equinely
  7. equines
  8. fourquine
  9. harlequinery
  10. harlequinesque
  11. palanquined
  12. palanquiner
  13. pamaquine
  14. pentaquine
  15. plasmoquine
  16. preterequine
  17. primaquine
  18. quinela
  19. quinelas
  20. quinella
  21. quinellas
  22. quinet
  23. quinetum
  24. sequined
  25. totaquine
  26. unequine
  27. vasquine
caseyc37 commented 5 months ago

The umlaut solves that issue, but frankly it's hard to type. Why not simply require that the word "quine" have whitespace (or file start/end) before and after? That avoids all overlap words.