Encyclopedia > HQ9 Plus

  Article Content

HQ9 Plus

HQ9+ is a simple but elegant programming language that is very efficient for coding certain classes of computer programs. It has four commands, each represented by a single character: H, Q, 9, and + (hence the name).

  • The Q command prints out a copy of the source code of the program.

  • The 9 command prints out the lyrics for 99 Bottles of Beer on the Wall.

An example HQ9+ program would be: "HHQ+HQ++"

This program would output "Hello, world! Hello, world! HHQ+HQ++ Hello, world! HHQ+HQ++" as well as incrementing the accumulator three times.

Of course, HQ9+ is a joke; each command represents a common task that beginners are given when learning a new programming language. A common exercise, for example, is to write a computer program that prints "Hello, world!". There are some programming languages in which this is actually quite difficult; however, in HQ9+ the task is elementary, since the program "H" will accomplish the task.



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article
Shoreham, New York

... 40°57'25" North, 72°54'31" West (40.956866, -72.908727)1. According to the United States Census Bureau, the village has a total area of 1.1 km² (0.4 ...

 
 
 
This page was created in 33.5 ms