hq9p - An HQ9+ Interpreter
hq9p [program_file | -]
The HQ9+ programming language has a simple syntax, and solves several very common problems that plague programmers.
There are four commands. While this is a very simple language, it allows you to easily do some things that would be very difficult in other programming languages.
All commands may appear more than once in your program, but it could produce some nasty output. All commands are case-insensitive.
Prints "Hello, world!" to the screen, sans the quotes. It will be trailed by a new-line character.
This makes your program a quine. It will print copies of itself.
Prints out the entire lyrics of the "99 bottles of beer on the wall" song.
Increments the accumulator.
Print "Hello, world!".
Print a quine.
Print four copies of your program.
Increment the accumulator.
Do it a lot.
All unknown commands will produce this warning. It's not wholy useful to quit execution, so a warning to STDERR will suffice. Unknown commands are any characters not included in the set case-insensitive set: 'h', 'q', '9', '+', and white-space characters.
The program will stop execution in the case of being unable to open a file. This may happen for the program file when passed to the interpreter, or when the command 'q' executes.
The program will stop execution in the rare case of being unable to close a file. This may happen for the program file when passed to the interpreter, or when the command 'q' executes.
Casey West <email@example.com>
Copyright (c) Casey West, all rights reserved. This software is governed by the Artistic License found within the source distribution.
HQ9+ Language Specification http://www.cliff.biffle.org/esoterica/hq9plus.html