esolang

wsad

Brainfuck typed with the four keys a gamer's left hand already rests on.

None1, 2023 · Turing complete: yes · ●○○ easy · esolangs.org

Tested with 3 known programs · Test method

Run it

Expected: 0

The idea

None1 made wsad from the four movement keys of a PC game. A command is two letters, so four letters give sixteen commands. Eight of them are brainfuck, and the other eight add number input and output, a second kind of loop, a break, a jump back to the start, a halt and a random byte.

Read the story

Any brainfuck program can be written in wsad by swapping each command for its pair, and the Hello World is exactly that.

The machine

First letterthen wthen sthen athen d
w+-[]
s,.<>
aRead a numberPrint a numberJump to ad if not 0Back to aa if 0
dHaltRandom byteBreak the loopBack to the start

Example

A truth machine.

A truth machine. aw reads the number and as prints it; with a 1 the wa ... wd loop prints it forever.

Expected: 4

The second is the XKCD random number, four increments and a print.

Further

Ideas it shows

wsad builds on Brainfuck.

Brainfuck derivatives

Write your own in Run Convert a program from wsad

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run wsad -e 'awaswaaswd' --input '0'
shib manual wsad

Source

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

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

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