CounterScript

From Esolang
Jump to navigation Jump to search

CounterScript is a model of computation created in March 2026 by User:Azerty.

Description

CounterScript is based on unbounded integer counters. It uses a minimal instruction set designed around incrementing, conditional decrementing, and looping.

The language has an unlimited number of variables (called counters), each storing a nonnegative integer. All counters are initialized to 0.

A CounterScript program is composed of three instruction types:

Command Description
X++; Increment x by 1
X--; If x is greater than 0, decrement x by 1
while X {...} Repeat a block while x is greater than 0

Examples

This program transfers the value of A into B:

while A {A--; B++;} end

This program never halts:

A++; while A {A++;} end

This program sets B to 6 (equals 3 * 2):

A++; A++; A++; while A > 0 {A--; B++; B++}

Design goals

CounterScript was designed to study extremely small programs, exhaustive enumeration, and Busy Beaver behavior.

Implementation