Home

Awesome

Whitespace

https://www.codewars.com/kata/52dc4688eca89d0f820004c6/train/java

Whitespace is an esoteric programming language that uses only three characters:

Whitespace is an imperative, stack-based programming language, including features such as subroutines.

Each command in whitespace begins with an Instruction Modification Parameter (IMP).

IMPs

Parsing Numbers

Parsing Labels

Input/Output

As stated earlier, there commands may read data from input or write to output.

Parsing Input

Writing Output

Commands

Notation: n specifies the parameter, [number] or [label].

Errors should be thrown for invalid numbers, labels, and heap addresses, or if there are not enough items on the stack to complete an operation (unless otherwise specified). In addition, an error should be thrown for unclean termination.

IMP [space] - Stack Manipulation

IMP [tab][space] - Arithmetic

IMP [tab][tab] - Heap Access

IMP [tab][line-feed] - Input/Output

IMP [line-feed] - Flow Control

Notes

Division and modulo

Whitespace expects floored division and modulo