mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 01:31:37 +00:00
1.0 KiB
1.0 KiB
name | filename | contributors | |||
---|---|---|---|---|---|
HQ9+ | hq9+.txt |
|
HQ9+ is a joke programming language created by Cliff Biffle. It has only four commands and it isn't Turing-complete.
There is only 4 commands, represented by next characters
H: print "Hello, world!"
Q: print the program's source code (a Quine)
9: print the lyrics to "99 Bottles of Beer"
+: add one to the accumulator (the value of the accumulator cannot be accessed)
Any other character is ignored.
Ok. Let's write some program:
HQ9
Result:
Hello world!
HQ9
HQ9+ is very simple, but allows you to do some things that are very difficult
in other languages. For example, here is a program that creates three copies of
itself on the screen:
QQQ
This produces:
QQQ
QQQ
QQQ
And that's all. There are a lot of interpreters for HQ9+. Below you can find one of them