Brainfuck: Difference between revisions

From BusyBeaverWiki
Jump to navigation Jump to search
Patcail (talk | contribs)
→Brainfuck Busy Beaver: added some more values
Patcail (talk | contribs)
 
(One intermediate revision by the same user not shown)
Line 39: Line 39:
== Brainfuck Busy Beaver ==
== Brainfuck Busy Beaver ==
'''BB<sub>brainfuck</sub>(n)''' returns the maximum value a pointer can be pointing at in program with n instructions when halting, using a version of brainfuck with unbounded arrays and integer cell values. The commands <code>.</code> and <code>,</code> are ignored.
'''BB<sub>brainfuck</sub>(n)''' returns the maximum value a pointer can be pointing at in program with n instructions when halting, using a version of brainfuck with unbounded arrays and integer cell values. The commands <code>.</code> and <code>,</code> are ignored.
[under construction, reference]
https://docs.google.com/spreadsheets/d/1fMavLTvRFnMe-PZ6NfVIDHlPgjcywVLLs1VkuaApi6k/edit?gid=101696978#gid=101696978
{| class="wikitable"
{| class="wikitable"
!n
!n
Line 151: Line 155:
|
|
|
|
|}
|-
|27
|
|
|-
|28
|
|
|-
|29
|
|
|-
|30
|≥ 220,283,786,963,581<ref name=":0" />
|<code>++++[>>+++++[-<++++>]<[-<]>>]></code>
|-
|31
|≥ 9<sup>9<sup>9<sup>33215</sup></sup></sup>
|<code>+[->+[->+++<]>[-<+++>]<<[-<]>]></code>
|-
|32
|
|
|-
|33
|
|
|-
|34
|
|
|-
|35
|
|
|-
}


=== '''Brainfuck Busy Beaver (original specifications + bi-infinite tape)''' ===
=== '''Brainfuck Busy Beaver (original specifications + bi-infinite tape)''' ===
==== '''Brainfuck Busy Beaver (original specifications + bi-infinite tape)''' ====
{| class="wikitable"
{| class="wikitable"
!n
!n
Line 218: Line 262:


[page under construction]
[page under construction]
== References ==
== References ==
<references />
<references />

Latest revision as of 19:40, 19 November 2026

Brainfuck is a Turing-complete language created in 1993 by Urban Muller. The language was designed to have an extremely tiny compiler (on the order of 200 bytes), while remaining Turing-complete.

Language Overview

Brainfuck operates on an array of memory cells, each initially set to zero. In the original implementation, the array was 30,000 cells long and each cell values would be limited to numbers from 0 to 255, but this may not be part of the language specification. A brainfuck program can work with different, and sometimes unbounded, array length and cells size.

Like in a Turing machine, there is a pointer, initially pointing to the first memory cell.

Programs are composed of commands, represented with symbols:

Command Operation
> Move pointer right
< Move pointer left
+ Increment current cell
- Decrement current cell
[ Jump forward past matching ] if current cell is zero
] Jump back to matching [ if current cell is non-zero
. Output current cell as a character (often ASCII)
, Input a character and store in current cell

Brainfuck Busy Beaver

BBbrainfuck(n) returns the maximum value a pointer can be pointing at in program with n instructions when halting, using a version of brainfuck with unbounded arrays and integer cell values. The commands . and , are ignored.

[under construction, reference] https://docs.google.com/spreadsheets/d/1fMavLTvRFnMe-PZ6NfVIDHlPgjcywVLLs1VkuaApi6k/edit?gid=101696978#gid=101696978

}

Brainfuck Busy Beaver (original specifications + bi-infinite tape)

Brainfuck Busy Beaver (original specifications + bi-infinite tape)

n BBbrainf(n) Champion
0 0
1 1 +
2 2 ++
3 3 +++
4 4 ++++
5 5 +++++
6 ≥ 6 ++++++
7 ≥ 7 +++++++
8 ≥ 8 ++++++++
9 ≥ 9 +++++++++
10 ≥ 10 ++++++++++
11 ≥ 11 +++++++++++
12 ≥ 12 ++++++++++++
13 ≥ 13 +++++++++++++
14 ≥ 16 ++++[->++++<]>
15 ≥ 20 +++++[->++++<]>
16 ≥ 25 +++++[->+++++<]>
17 ≥ 176[1] ++[>+++++[-<]>>]>
18 ≥ 3,175[1] ++[>++++++[-<]>>]>
19 ≥ 3,176 ++[>++++++[-<]>>]>+
20 ≥ 3,177 ++[>++++++[-<]>>]>++
21 ≥ 4,212[1] +[->++++++++++[-<]>]>
22 ≥ 6,234[1] +++[>+++++++++[-<]>>]<
23 ≥ 90,963[1] +++[>++++++++++[-<]>>]>
24 ≥ 7,467,842[1] +++[>+++++++++++[-<]>>]<
25 ≥ 239,071,921[1] +++[>++++++++++++[-<]>>]<
26
27
28
29
30 ≥ 220,283,786,963,581[1] ++++[>>+++++[-<++++>]<[-<]>>]>
31 ≥ 99933215 +[->+[->+++<]>[-<+++>]<<[-<]>]>
32
33
34
35
n Maximum steps[2] Champion
0 0
1 1 +
2 2 ++
3 3 +++
4 512 +[+]
5 767 +[.+]
6 1,022 +[..+]
7 1,277 +[...+]
8 1,532 +[....+]
9 226,702 +[+[>]-<]
10 650,258 +[>+[<]->]
11 1,269,654 +[>+[<]->>]
12 8,734,764 +[>--[<]+>+]
13 47,244,577,523 +[>+[[<]<]>-]


[page under construction]

References

References