esolang

BizOffers

A plain little language whose IDE keeps slipping offers into your code.

SpaceByte, 2022 · Turing complete: yes · ●○○ easy · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: Hello World

The idea

SpaceByte made BizOffers on 10 July 2022, with syntax after C and an IDE after Uyjhmn n. The language itself is small. It has seven commands, one per line, on named variables that hold doubles.

Read the story

The joke is the IDE, which was the only way to run a program. After each line it may force in an offer, with a chance of 1 in 5. An offer is one more line of code that changes what your program does, and you have to write your program so that it undoes the offer. The specification does not say what the offers are, so this implementation leaves them out and runs a program as it is written.

The machine

LineDoes
set n out vSet the variable v to n
input out vRead one key into v as its code; v must be set first
output string textPrint the rest of the line
output char nPrint the character with code n
operate a op b out vPut a op b in v, op being + - x / or %
if n ifnot nRun the next line only when n is not 0, or only when it is 0
goto nGo on at line n

Where a number goes, a variable name gives its value. A line that starts with any other word is a comment. Lines count from 1.

Example

A loop counts c from 65 and jumps back while c - 68 is not 0.
Expected: x

A loop counts c from 65 and jumps back while c - 68 is not 0.

Expected: ABC

Further

Also in Jokes

Write your own in Run Convert a program from BizOffers

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run bizoffers -e 'output string Hello World'
shib manual bizoffers

Source

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

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

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