Where is an esoteric programming language created by User:Ketok.
Where operates on 4 memory cells, initially set to 1, 2, 3, 4. Each cell can have value ranging from 0 to 255.
WHERE condition action
Where statement executes action on all cells fulfilling given condition.
WHERE >2 SET 255
will set all memory cells with value higher than 2 to 255.
Condition can be one of:
with n being any numerical value ranging from 0 to 255.
Action can be one of:
- SET value
- ADD value
- SUB value
with value also being any numerical value ranging from 0 to 255.
WHILE [ANY|ALL] condition ... END
While statements executes its contents while all/any cells fulfill given condition.
# Truth machine WHERE =1 INPUT WHERE =0 OUTPUT WHILE ANY =1 WHERE =1 OUTPUT END
# A simple program that adds two numbers toghether WHERE >1 ADD 251 WHERE =1 INPUT WHERE <253 ADD 128 WHERE =253 INPUT WHERE >253 SET 0 WHILE ANY >128 WHERE >128 SUB 2 WHERE >0 ADD 1 END WHERE =0 SET 255 WHERE <128 OUTPUT
Interpreter for Where is written in F# with FParsec. It can be downloaded from github.