Search for a tool
Whitespace Language

Tool to decode / code in whitespace, an exotic programming language that only uses blank / invisible characters like space, tab or newline/line feed.

Results

Whitespace Language -

Tag(s) : Programming Language

Share
Share
dCode and more

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!


Please, check our community Discord for help requests!


Thanks to your feedback and relevant comments, dCode has developped the best 'Whitespace Language' tool, so feel free to write! Thank you !

Whitespace Language

Interpret/Execute Whitespace code


  [X]



See also: Brainfuck

Code some text with Whitespace




See also: Javascript

Tool to decode / code in whitespace, an exotic programming language that only uses blank / invisible characters like space, tab or newline/line feed.

Answers to Questions

What is Whitespace language? (Definition)

The Whitespace programming language gets its name from the fact that it uses only the 3 white characters: space, tab and newline. The source code of programs written in Whitespace are therefore invisible.

In order to make the code visible, it is common to use 3 characters: S for space (Space), T for tabulation (Tab), and L for new line (Line feed).

All visible characters are ignored by the program and can be used as comments (or to catch attention).

How to code in Whitespace?

The whitespace uses a stack, a heap and 22 structured instructions, which start with an IMP (Modification Parameter Instruction) among 5 possible: S (space) modifies the stack, TS (tab + space) performs a calculation, TT (tab + tab) accesses the heap, L (line feed) manages the goto / jump of the program and TL (tab + line feed) manages I / O.

The complete list of 22 Whitespace instructions:

IMP + CommandParameterDescription
S SNumberStacks the number
S LSCopy top of stack
S LTReverse the top two items of the stack
S LLRemove top of stack
TS SSAddition
TS STSubtraction
TS SLMultiplication
TS TSInteger Division
TS TTModulo
TT SSave to heap
TT TGet the heap
L SSLabelCreate a label in the program
L STLabelLabel call
L SLLabelJump to the label
L TSLabelJump to label if top of stack is 0
L TTLabelJump to the label if the top of the stack is <0
L TLEnd of the subroutine, and return
L LLEnd of program
TL SSShow top of stack as ASCII character
TL STDisplay top of stack as an integer
TL TSRead a character and save it at the address described by the top of the stack
TL TTRead a number and store it at the address described by the top of the stack

The numbers respect a specific syntax: sign + absolute values in binary + line feed. The sign is S (space) for positive or T (tabulation) for negative. The value of the number is written in binary with S (space) for 0 and T (tabulation) for 1.

Example: The number +97 is positive (coded S) and has the binary value 1100001 (coded TTSSSST), so it is coded as S TTSSSST L

Example: SS STTSSSSTL TLSS corresponds to the instruction stacks the number 97 and displays it as an ASCII character, so the program displays a.

How to decode Whitespace?

The interpretation of white-space corresponds to the reading and application of coded instructions.

On dCode, it is possible to read a file (generally with the extension .ws) or to copy and paste a program (be careful not to add a space or a new line unintentionally because this could cause errors)

The execution is done in the browser, with JavaScript.

How to recognize a Whitespace code?

The message is invisible, consisting only of spaces, tabs and newlines.

Sometimes the characters S, T and C accompany the code.

It is possible to accompany the code with any text (visible characters only) without affecting it, so it is an excellent method of steganography.

When Whitespace have been invented ?

Whitespace was described on April 1, 2003 by Edwin Brady and Chris Morris (as an April Fool) at Durham University.

Source code

dCode retains ownership of the online 'Whitespace Language' tool source code. Except explicit open source licence (indicated CC / Creative Commons / free), any algorithm, applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or any function (convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (PHP, Java, C#, Python, Javascript, Matlab, etc.) no data, script or API access will be for free, same for Whitespace Language download for offline use on PC, tablet, iPhone or Android !

Need Help ?

Please, check our community Discord for help requests!

Questions / Comments

Thanks to your feedback and relevant comments, dCode has developped the best 'Whitespace Language' tool, so feel free to write! Thank you !


Source : https://www.dcode.fr/whitespace-language
© 2020 dCode — The ultimate 'toolkit' to solve every games / riddles / geocaching / CTF.
Feedback