GitXplorerGitXplorer
e

go-quines

public
15 stars
0 forks
0 issues

Commits

List of commits on branch main.
Verified
94095009ed5d4aa22bdf4097cc979367d96a7896

Some grammar tweaks to README

eeliben committed 2 years ago
Unverified
8c1e68fc8e45543674bfa5cf4ab2749276aa24de

Clarify README comment more

eeliben committed 2 years ago
Unverified
1e5a2d8e5d7e463b260deb3a8bc0d5a962305a17

Clarify a comment in README

eeliben committed 2 years ago
Unverified
ba3da94aecf15bd7810da09960bfdf6386e285f6

Add another quine sample - byte encoding

eeliben committed 2 years ago
Unverified
0e5540989dca8174a5e24020247bc2121ce83864

README tweaks

eeliben committed 2 years ago
Unverified
d9851098a5c5fa716d234aad0e1a8106be4cfde5

Add embedding quine sample

eeliben committed 2 years ago

README

The README file for this repository.

go-quines

Some quines in the Go programming language

  • quine-str-regular.go: A quine I came up with after reading some Python code that does something similar. It's very simple, without using any special ASCII codes for quotes, but it does require a lot of the code on one long line.
  • quine-str-rsc.go: A quine crafted by Russ Cox and shown in a 2010 blog post. This one is using the Go backtick quote for nicer code formatting. It also demonstrates a common technique used in quines to make sure quoting works out, by passing an ASCII code for quotes to the printing function.
  • quine-source-embed.go: A bit of a "cheat". Reading your own source code and spitting it out is an obvious way to write quines, but it's so easy that it's usually frowned upon. "Morally pure" quines are not supposed to issue file reading calls; this one doesn't -- it uses the embedded file support added in Go 1.16 to make the toolchain read the file for us.
  • quine-byte-encoding.go: Uses a common byte-encoding trick where the program is encoded somehow (in this case simply as integer values for its bytes) and the encoding is printed twice - once plainly, and once decoded. This is a very general approach, applicable in any language (even Assembly!)