CounterScript: Difference between revisions

From BusyBeaverWiki
Jump to navigation Jump to search
Azerty (talk | contribs)
→BBCS: Added more lower bounds
Polygon (talk | contribs)
m →BBCS: spacing
Line 92: Line 92:
|-
|-
|11
|11
|≥20
|≥ 20
|<code>A++; A++; A++; A++; A++; while A {A--; B++; B++; B++; B++;}</code>
|<code>A++; A++; A++; A++; A++; while A {A--; B++; B++; B++; B++;}</code>
|-
|-
|12
|12
|≥25
|≥ 25
|<code>A++; A++; A++; A++; A++; while A {A--; B++; B++; B++; B++; B++;}</code>
|<code>A++; A++; A++; A++; A++; while A {A--; B++; B++; B++; B++; B++;}</code>
|-
|-
|13
|13
|≥30
|≥ 30
|<code>A++; A++; A++; A++; A++; A++; while A {A--; B++; B++; B++; B++; B++;}</code>
|<code>A++; A++; A++; A++; A++; A++; while A {A--; B++; B++; B++; B++; B++;}</code>
|-
|-
|14
|14
|≥84
|≥ 84
|<code><nowiki>A++; A++; A++; while A {A--; B++; while B {B--; C++; C++;} while C {C--; B++; B++;}}</nowiki></code>
|<code><nowiki>A++; A++; A++; while A {A--; B++; while B {B--; C++; C++;} while C {C--; B++; B++;}}</nowiki></code>
|-
|-
|15
|15
|≥340
|≥ 340
|<code><nowiki>A++; A++; A++; A++; while A {A--; B++; while B {B--; C++; C++;} while C {C--; B++; B++;}}</nowiki></code>
|<code><nowiki>A++; A++; A++; A++; while A {A--; B++; while B {B--; C++; C++;} while C {C--; B++; B++;}}</nowiki></code>
|-
|-
|16
|16
|≥1364
|≥ 1364
|<code><nowiki>A++; A++; A++; A++; A++; while A {A--; B++; while B {B--; C++; C++;} while C {C--; B++; B++;}}</nowiki></code>
|<code><nowiki>A++; A++; A++; A++; A++; while A {A--; B++; while B {B--; C++; C++;} while C {C--; B++; B++;}}</nowiki></code>
|}
|}

Revision as of 10:09, 27 May 2026

CounterScript is a minimal counter-based programming language designed for Busy Beaver–style program enumeration and analysis.

It features a very small instruction set operating over an unbounded set of nonnegative integer variables (counters).

BBCS(n) is the Busy Beaver function for CounterScript programs.

Definition

A CounterScript program consists of a finite sequence of instructions drawn from three primitives:

  • Increment a counter
  • Conditional decrement
  • While loop

All counters are initialized to 0 and can grow without bound.

The model is closely related to Minsky register machines, Fractran and Brainfuck, and is therefore Turing-complete.

Instructions

Instructions are executed one by one from left to right.

Name Command Definition
Increment A++ Increment counter A by 1
Decrement A-- Decrement counter A by 1 if A > 0
While loop while A {...} Executes the loop body while x > 0

BBCS

The Busy Beaver function for CounterScript, denoted BBCS(n), returns the largest score a CounterScript program of length n can have when halting.

The score of a program is the maximum value of its counters.

The length of a CounterScript program is defined as the total number of instructions.

By example, A++; B++; while A {A--; C++; C++;} has length 6 and its score is 2.

n BBCS(n) Champion
1 1 A++;
2 2 A++; A++;
3 3 A++; A++; A++;
4 4 A++; A++; A++; A++;
5 5 A++; A++; A++; A++; A++;
6 6 A++; A++; A++; A++; A++; A++;
7 7 A++; A++; A++; A++; A++; A++; A++;
8 9 A++; A++; A++; while A {A--; B++; B++; B++;}
9 12 A++; A++; A++; A++; while A {A--; B++; B++; B++;}
10 16 A++; A++; A++; A++; while A {A--; B++; B++; B++; B++;}
11 ≥ 20 A++; A++; A++; A++; A++; while A {A--; B++; B++; B++; B++;}
12 ≥ 25 A++; A++; A++; A++; A++; while A {A--; B++; B++; B++; B++; B++;}
13 ≥ 30 A++; A++; A++; A++; A++; A++; while A {A--; B++; B++; B++; B++; B++;}
14 ≥ 84 A++; A++; A++; while A {A--; B++; while B {B--; C++; C++;} while C {C--; B++; B++;}}
15 ≥ 340 A++; A++; A++; A++; while A {A--; B++; while B {B--; C++; C++;} while C {C--; B++; B++;}}
16 ≥ 1364 A++; A++; A++; A++; A++; while A {A--; B++; while B {B--; C++; C++;} while C {C--; B++; B++;}}

Cryptids

TODO