Taxi Programming Language

The Taxi Programming Language is an esoteric programming language developed in 1995. It uses an analogy of a town known as "Townsburg" in which there are several destinations at which variables, called "passengers," can be picked up or dropped off. When passengers are dropped off, they often undergo some sort of manipulation. For instance, two numerical passengers dropped off at Addition Alley will turn into one passenger waiting there, whose value is the same as the sum of the two original passengers' values.
Use
The Taxi Programming Language makes use of English-like sentences to do work. Most commands involve navigation in Townsville according to this map, picking up passengers, and refueling. For example, to multiply two numbers supplied by the user:
<code>
Go to the Post Office: west 1st left, 1st right, 1st left.
Pick up a passenger going to Multiplication Station.
Pick up another passenger going to Multiplication Station.
Go to Multiplication Station: south 1st left, 3rd left.
Pick up a passenger going to the Post Office.
Go to the Post Office: south 1st left, 3rd right.
Go to the Taxi Garage: north 1st right, 1st left, 1st right.
</code>
In this block of code, the "Taxi Garage" is where the pointer (taxi) starts and must stop to indicate successful termination. Any passengers dropped off at the "Post Office" are written to stdout, and passengers can be picked up corresponding to input read from stdin. "Multiplication Station" takes every two passengers dropped off there, and multiplies them to form a new passenger with that value.
In Taxi, unlike other languages, the pointer uses "gas" to move around Townsville. Gas must be purchased when it runs out. The money comes from a flat fee of $0.07 per mile per passenger. If the taxi runs out of gas, the program terminates unsuccessfully.
 
< Prev   Next >