Skip to content

Instantly share code, notes, and snippets.

@mliezun
Created November 26, 2022 18:26
Show Gist options
  • Save mliezun/c750ba701608850bd86d646a3ebf700f to your computer and use it in GitHub Desktop.
Save mliezun/c750ba701608850bd86d646a3ebf700f to your computer and use it in GitHub Desktop.
Grotsky Quine
let tabChar = 9
let quoteChar = 34
let commaChar = 44
let code = [
"let tabChar = 9",
"let quoteChar = 34",
"let commaChar = 44",
"let code = [",
"]",
"for let i = 0; i < 4; i = i+1 {",
" io.println(code[i])",
"}",
"for let i = 0; i < code.length; i = i+1 {",
" io.println(strings.chr(tabChar) + strings.chr(quoteChar) + code[i] + strings.chr(quoteChar) + strings.chr(commaChar))",
"}",
"for let i = 4; i < code.length; i = i+1 {",
" io.println(code[i])",
"}",
]
for let i = 0; i < 4; i = i+1 {
io.println(code[i])
}
for let i = 0; i < code.length; i = i+1 {
io.println(strings.chr(tabChar) + strings.chr(quoteChar) + code[i] + strings.chr(quoteChar) + strings.chr(commaChar))
}
for let i = 4; i < code.length; i = i+1 {
io.println(code[i])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment