Skip to content

Instantly share code, notes, and snippets.

@JustinSDK
Last active September 21, 2020 01:41
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JustinSDK/5382129 to your computer and use it in GitHub Desktop.
Save JustinSDK/5382129 to your computer and use it in GitHub Desktop.
The Scala example of "AlgorithmGossip: Quine"
val s="print(\"quine\")";val v="val s=val v=val c=val p=";val c="\\\";";val p="print(v.slice(0,6)+c(1)+s.slice(0,6)+c.slice(0,2)+s.slice(7,12)+c.slice(0,2)+s.last+c.slice(1,3)+v.slice(6,12)+c(1)+v+c.slice(1,3)+v.slice(12, 18)+c(1)+c(0)+c(0)+c(0)+c.slice(1,3)+c.slice(1,3)+v.slice(18, 24)+c(1)+p+c.slice(1,3)+p)";print(v.slice(0,6)+c(1)+s.slice(0,6)+c.slice(0,2)+s.slice(7,12)+c.slice(0,2)+s.last+c.slice(1,3)+v.slice(6,12)+c(1)+v+c.slice(1,3)+v.slice(12, 18)+c(1)+c(0)+c(0)+c(0)+c.slice(1,3)+c.slice(1,3)+v.slice(18, 24)+c(1)+p+c.slice(1,3)+p)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment