4 ms·
Show HN: Quinesnake – A quine that plays snake over its own source
- atum47 7y agoVery cool
- gatherhunterer 7y agoAre there resources for making a quine that improve the development process or is it exactly as insanely tedious as it looks? Because this looks pretty impressive.
- techslave 7y agoWe don’t do this, that and the other thing because they are easy, we do it because they are hard. The tedium is part of the difficulty. Making it easier is not inspirational. Although buildings the tooling to do so would itself be quite the challenge ...
- taylorconor 7y agoUnfortunately it's a pretty manual, tedious and frustrating process, especially when the code is minified and you want to squeeze it into as small a source file as possible.
- austinjp 7y agoGratifying to read the author say that creating something as mind-boggling this was tedious and frustrating. It's great, by the way :)
- klyrs 7y agoA generic (pseudo) quine is: s = "print escape(s)\n{payload}" print "s = " print escape(s) {payload} So if you wanna do extra stuff on top of being a quine, just write that program and bootstrap with escape()
- akkartik 7y agohttp://www.madore.org/~david/computers/quine.html http://www.madore.org/~david/computers/quine.html
- gatherhunterer 7y agoThanks for the reference.
- User23 7y agoAlso https://en.m.wikipedia.org/wiki/Kleene's_recursion_theorem https://en.m.wikipedia.org/wiki/Kleene's_recursion_theorem
- gitgud 7y agoA quine is a computer program which takes no input and produces a copy of its own source code as its only output. The standard terms for these programs in the computability theory and computer science literature are "self-replicating programs", "self-reproducing programs", and "self-copying programs". So it's a self-replicating game of snake? Sounds very much like a worm virus. Very nice project though!
- muthdra 7y agoNot exactly. It prints exactly it's own source code as output but it doesn't run it again. You can run a quine output manually as it's by definition the same code that printed it but it lacks the ability to keep executing continuously like a worm virus would require. I guess you could make a worm virus that's also a quine but that would be a whole other problem.
- eps 7y agoThis is spectacular! You had me at ./quinesnake.cpp The rest is just the icing on a cake :)
- codetrotter 7y agoSo it’s not just a quine, but a polyglot quine even. They are the best :)
- deleted 7y ago[deleted]
- Sniffnoy 7y agoThis is really neat! Unfortunately the color isn't working for me for some reason, which makes locating the initial food quite difficult. Any idea what could cause that?
- taylorconor 7y agoOh that sucks, the whole point of programs like these is that they should still be portable. Could you make a GitHub issue (or email me) with your platform, shell, compiler version and curses version?
- Sniffnoy 7y agoSure thing!
- purplezooey 7y agoA quine produces a copy of its own source, but quinine is the stuff they put in tonic water.