Typespam
Jump to navigation
Jump to search
Typespam is a cell-based language created by User:Zip. It is a cell-based language somewhat similar to brainfuck.
Data
Instead of a tape, Typespam has a "chain", which is identical other than the fact that it is visualized vertically. Individual values on the chain (called "instances") hold a 16-bit signed integer and a character. An instance has a type which determines whether accessing the instance gives its integer or character value. Instances may also be uninitialized, in which case accessing them is an error.
Commands
| Command | Description |
|---|---|
_
|
Initialize the value under the pointer, settings its type to character, and setting its values to the integer 0 and the character space. |
^
|
Move up the chain. |
v
|
Move down the chain. |
c
|
Set the instance's type to character. |
i
|
Set the instance's type to integer. |
{x
|
Set the instance to the character or integer after this command. When setting to an integer, x is interpreted using the same semantics as the Java Character#getNumericValue method. |
|x
|
Create a marker with name x. Markers are created as the program is evaluated; there is no pre-processing step. | can also overwrite existing markers with the same character.
|
}x
|
Jump to the marker x if the value under the pointer is an integer and is nonzero. |
-
|
Display the value of the current instance. |
#
|
Get one key of input and put it into the current instance. If the instance's type is an integer, the integer value of the character is stored to the instance's integer component, otherwise the character is directly stored to the instance's character component. |
All other characters are ignored.
Examples
Hello World
_c {H-{e-{l--{o-{ -{W-{o-{r-{l-{d-
Cat program
The following implements an infinitely repeating cat program using markers:
_ c |A #- }A
Interpreter
- Common Lisp implementation of the Typespam programming language. (Note: Most likely inaccurate after a recent edit)