FANDOM


Brain-Flak specification:

There are only 8 valid characters that are accepted in Brain-Flak. If a code contains an invalid character, then the code is invalid.
Start with two infinite stacks (left and right), which are a type of memory where elements can be pushed (add a number as the first element and move the rest of the elements down a stack) and popped (remove the first element and move the rest of the elements up a stack). The active stack starts at left. 
() evaluates as 1.
(n) evaluates as and pushes n on top of the active stack.
[] evaluates as the active stack height.
[n] evaluates as -n.
{} pops and evaluates as the top of the active stack.
{foo} does foo until the number at the top of the active stack is 0, then evaluates as the sum of what the brackets at layer 0 (the brackets that are not contained inside other brackets) evaluate to.
<> switches between active stacks (if active stack is left, <> will switch it to right, and if active stack is right, <> will switch it to left)
<foo> does foo, but evaluates as 0.
After the code ends, add the numbers that the brackets at layer 0 evaluate to, and that is what the code evaluates to.

I define Flak(x) as the biggest displayed number possible with 2x characters of Brain-Flak program. Of course this is uncomputable.

Some other variants:

Flak+(x) changes the number that [] evaluates to from the height of the active stack to -1.

Flak+(x) changes the function of (n) from pushing n on top of the active stack to adding n at the bottom of the active stack.

Flak++ changes the number that [] evaluates to from the height of the active stack to -1 and changes the function of (n) from pushing n on top of the active stack to adding n at the bottom of the active stack.

First programs are simple:

Flak(1)=1 ()
Flak(2)=2 ()()
Flak(3)=3 ()()()
Flak(4)=4 ()()()()

Here are some more examples:

  • Flak(5) = 6 (()()()){}
  • Flak(6) = 8 (()()()()){}
  • Flak(7) >= 12 ((()()()){}){}
  • Flak(8) >= 16 ((()()()()){}){}
  • Flak(9) >= 24 (((()()()){}){}){}
  • Flak(10) >= 32 (((()()()()){}){}){}
  • ...
  • Flak(24) >= 4096 ((((((((((()()()()){}){}){}){}){}){}){}){}){}){}
  • Flak(25) >= 49152 <((((()()()){}){}))({}<>){({}[()])<>(({}){})<>}><>
  • Flak(26) >= 1048576 <((((()()()()){}){}))({}<>){({}[()])<>(({}){})<>}><>

Anyone know any approximations for higher values of x in Flak(x)?

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.