We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Beating around the bush

From Esolang
Jump to navigation Jump to search
Beating Around the Bush
Paradigm(s) Imperative
Designed by Thomas Bestvina
Appeared in 2026
Memory system Tree-based
Computational class Unknown
Major implementations Original


Beating Around the Bush (BAtB) is a tree based esoteric programming language designed in November 2026 by Thomas Bestvina.

The program starts as the seed of a bush, your job is to growing this bush in specific ways to compute. Each vertex has a 0.01% chance of creating a new child vertex after each command.

Commands

Command Description
% Trim children
* Add child to current vertex
> Select next child (clamps at next-most child)
< Select previous child (clamps at 0)
v Descend into selected child
^ Ascend into parent
{ Jump past matching } if current vertex is a leaf
} Jump back to matching { if current vertex is not a leaf
# Grow current vertex by input amount as a character
@ Print how many descendants a vertex has as a character

Some of the commands have important details when writing BAtB code.

When descending into a non-existent child, your clippers simply miss, you should probably go back up.

A non-existent vertex is, technically, not a leaf.

Ascending from the root node simply halts the program, no command could recover this state regardless.

Ascending to a vertex will keep the previous vertex as selected.

All characters other than %*><^v{}#@ should be considered comments and ignored.

Examples

Hello, World!

There are two approaches to hello world, you can either have a higher chance of getting many characters right, or a higher chance of getting all characters right, but not as many on average.

"Hello, World!" Shortened naive approach

 *v 72*@
 ^*>v 101*@
 ^*>v 108*@@
 ^*>v 111*@
 ^*>v 44*@
 ^*>v 32*@
 ^*>v 87*@
 ^*>v 111*@
 ^*>v 114*@
 ^*>v 108*@
 ^*>v 100*@
 ^*>v 33*@
 ^*>v 10*@

You should use python to expand the *'s to make a runnable program.

"Hello, World!" Non-naive approach

 *v*v*v*v*v*v*v*v*v*v*v*v
 ^^^^^^^^^^^^ Make 12 nodes and go back to root
 {*******v} In each node grow 7 until it reaches the bottom node
 ^^^^^^^^^@ Go up 9 nodes count is exactly 72(H)
 ^^^*****@ Up 3 to the root Add 5 to reach 101(e)
 *******@@ Add 7 to reach 108 print twice(ll)
 ***@ Add 3 to reach 111.(o)
 vvvvvvv****@ Down 7 nodes add 4 to reach 44(,)
 v@ Down 1 node count is exactly 32 (' ')
 ^^^^*******************@ Up 4 nodes add 19 to reach 87(W)
 ^^^@ Up 3 nodes count is already 111(o)
 ***@ Add 3 to reach 114(r)
 v*****@ Down 1, add 5 to reach 108(l)
 v*****@ Down 1, add 5 to reach 100(d)
 vvvvv*@ Down 5, add 1 to reach 33(!)
 vvv**@ Down 3, add 2 to reach 10 (\n)

This will give you "Hello, World!" about 20% of the time!

The same program in minimized form

 *v*v*v*v*v*v*v*v*v*v*v*v^^^^^^^^^^^^{*******v}^^^^^^^^^@^^^*****@*******@@***@vvvvvvv****@v@^^^^*******************@^^^@***@v*****@v*****@vvvvv*@vvv**@

Truth Machine

 #@>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>   Input your character, go to child that marks '0'
 v*^  Mark '0' by adding a child and come back
 > We attempt to go to the right, in the case of 1, this is successful, and the child is a leaf,
 in the case of 0 this is not successful and the child is not a leaf we enter the child and check if it is a leaf
 v{^^} we enter the child and check if it is a leaf
 in the case of 1, it is a leaf, so we skip past to },
 in the case of 0, it is not a leaf, so go up once to the root, then once again which exits the program
 ^{%*************************************************@} go back to root, we enter a loop because its not a leaf,
 remove all children, add 49 children to make a '1', print, it is not a leaf, so we repeat.

The truth machine will occasionally fail for inputs of 0, for inputs of 1, it will loop infinitely, but will sometimes print 2, and occasionally 3.

The same program in minimized form

 #@>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>v*^>v{^^}^{%*************************************************@}

Computational Class

BAtB is most likely not Turing complete, as it is likely you cannot design a program that can recover from a worst case scenario of all vertices growing a new vertex in some generic way.

External Resources