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
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 letter | then w | then s | then a | then d |
|---|---|---|---|---|
| w | + | - | [ | ] |
| s | , | . | < | > |
| a | Read a number | Print a number | Jump to ad if not 0 | Back to aa if 0 |
| d | Halt | Random byte | Break the loop | Back 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.
The second is the XKCD random number, four increments and a print.
Further
Ideas it shows
See also
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 wsadSource
- 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