Science Fair Projects Ideas - HQ9 Plus

All Science Fair Projects

      

Science Fair Project Encyclopedia for Schools!

  Search    Browse    Forum  Coach    Links    Editor    Help    Tell-a-Friend    Encyclopedia    Dictionary     

Science Fair Project Encyclopedia

For information on any area of science that interests you,
enter a keyword (eg. scientific method, molecule, cloud, carbohydrate etc.).
Or else, you can start by choosing any of the categories below.

HQ9 Plus

HQ9+ is a joke programming language created by Cliff Biffle that consists of only four commands, each represented by a single character: H, Q, 9, and +. It is not Turing-complete, but it is highly efficient at certain types of programs.

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.

It is claimed that all useful programs written in HQ9+ run over twice as fast as the same programs written in any other language. Since no useful programs can be written in HQ9+, this is vacuously true.

HQ9+ is a joke; each command represents a common task that beginners are given when learning to program, or that programmers give themselves 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. One of the hardest tasks in many programming languages is to write a quine, that is, a program which prints its own source code. However, in HQ9+, this is also trivial.

HQ9+ interpreters are extremely simple to write, so there have been many written. For example, Hq9-plus.py HQ9+ interpreter was written (in Python) in around five minutes and is only 18 lines long. And, Hq9p.c HQ9+ compiler written in C compiles HQ9+ programs to C code and is only about 40 lines long.

Since HQ9+ programs do not accept input, it is not possible to write an HQ9+ interpreter or compiler in HQ9+.

There is also another joke language called HQ9++ created by David Morgan-Mar, an object-oriented language backward compatible with HQ9+. This adds a new command, ++, which increments the accumulator twice and instantiates an object. Following the principle of information hiding, it is not possible to access this object.

External links

10-26-2009 08:16:03
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details
Science kits, science lessons, science toys, maths toys, hobby kits, science games and books - these are some of many products that can help give your kid an edge in their science fair projects, and develop a tremendous interest in the study of science. When shopping for a science kit or other supplies, make sure that you carefully review the features and quality of the products. Compare prices by going to several online stores. Read product reviews online or refer to magazines.

Start by looking for your science kit review or science toy review. Compare prices but remember, Price $ is not everything. Quality does matter.
Science Fair Coach
What do science fair judges look out for?
ScienceHound
Science Fair Projects for students of all ages
All Science Fair Projects.com Site
All Science Fair Projects Homepage
Search | Browse | Links | From-our-Editor | Books | Help | Contact | Privacy | Disclaimer | Copyright Notice