esolang

WASD

Brainfuck for one hand. Every command sits under the left hand on a QWERTY keyboard.

Max00355, 2012 · Turing complete: unknown · ●○○ easy · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: Hello World!

The idea

Max00355 made WASD in 2012, after brainfuck, so that a program could be typed with one hand. The four letters are the movement keys of many PC games. d and a move the pointer right and left, and w and s move the cell's value up and down. Output is e, input q, and the loop brackets became 1 and 2.

The machine

CommandDoesbrainfuck
d aMove the pointer right or left> <
w sAdd or take away 1+ -
ePrint the cell as a character.
qRead input into the cell,
1 2Start and end a loop[ ]
( ... )A comment

This implementation is a subset. It runs d, a, w, s, e and comments, and leaves out 1, 2 and q. The specification says WASD works the way brainfuck works, but it also says the loop of 1 starts when the cell is 0, which is the opposite of brainfuck. It does not say what q makes of the input. A program with any of the three stops with an error before it runs.

Example

The Hello World builds H in cell 1 and the rest in cell 2.

The Hello World builds H in cell 1 and the rest in cell 2. It goes back to cell 1 once, to add 15 and make the W.

Expected: **

The second program counts one cell up to 42 and prints it twice.

Further

Ideas it shows

WASD builds on Brainfuck.

Brainfuck derivatives

Write your own in Run Convert a program from WASD

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: wasd.

Command line

shib run wasd -e '(this is a comment)'
shib manual wasd

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/wasd.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org