esolang

UpDown

Twenty-six variables, and the only things you can do are push them up, push them down and print them.

IdfbAn, 2022 · Turing complete: no · ●○○ easy · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: Hello, World!

The idea

IdfbAn made UpDown on 30 December 2022. There is a variable for each letter from A to Z, all starting at 0, and three commands. There are no loops and no input, so every program is a straight line of steps that always ends. Printing gives the character with the variable's code, and a value below 0 or above 255 prints an error message instead.

Read the story

UD++ is an optional extension from the same specification. It adds var, which makes a variable with a name of your own.

The machine

CommandDoes
up V n;Add n to V
down V n;Take n from V
print V;Print the character with V's code
var name;UD++ only, make a new variable at 0

print on a value below 0 prints Error! Value of V too low, and above 255 Error! Value of V too high. The program goes on after it.

Example

The Hello World keeps every letter in a variable of its own and reuses C and E.

The Hello World keeps every letter in a variable of its own and reuses C and E.

The UD++ example.

Expected: fr
Expected: Error! Value of A too low

Further

Ideas it shows

Also in Jokes

Write your own in Run Convert a program from UpDown

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run updown -e ' var first_letter;
 var second_letter;
 
 up first_letter 102;
 up second_letter 114;
 
 print first_letter;
 print second_letter;'
shib manual updown

Source

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

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

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