Something?Oops!
Jump to navigation
Jump to search
Something?Oops! is a simple esolang by User:A.
Syntax
The syntax is as follows:
Statement: "<identifier> <identifier>?Oops<variable>" Identifier: A nonnegative integer or a variable Variable: "!" or "?" or "." or ","
Commands
A statement of the form A B?OopsC
stores A
+ B
in C
.
As opposed to traditional programming languages, the various effects, including value storage, input/output, and control flow, does not depend upon the choice among the available instructions, but upon utilized variables and whether they are applied in a reading or writing context.
Four variables exist, each of which distinguished by their identity and side effects:
Variable | Effect |
---|---|
?
|
Is a special variable in that reading from it produces input from the user rather than ? 's value, thus making ? effectively read-only as a variable. The user input is expected to be communicated in the form of a nonnegative integer number.
|
.
|
Produces output, and though it can be used as a normal variable, anything written to it is also output to the screen. |
,
|
Is also special: it's the instruction counter. When reading, it returns the current instruction index. When writing, a jump (goto) to the specified instruction is exercised. The enumeration starts at one (1). |
!
|
In fact, only ! is a “normal” variable at all.
|
Example
Truth-machine
? 2?Oops, 0 5?Oops, 0 1?Oops. 0 3?Oops, 0 0?Oops.
Counter
This short program prints the numbers 1, 2, and 3 by employment of the instruction counter.
0 ,?Oops. 0 ,?Oops. 0 ,?Oops.
Interpreter
- Common Lisp implementation of the Something?Oops! programming language.