7
2
This challenge is for the largest finite number you can get BrainFuck programs of given lengths to contain in memory.
We must use one of the BF versions that uses big integers for the cells rather than byte values as not to be capped at 255. Do not use negative positions and values in memory. Do not use the BF instruction to input memory, also the output instruction is not needed.
Challenge:
Write Brainfuck programs with lengths from 0 to 50. Your score is the sum of each programs maximum value in memory.
As they may well be trivial feel free to omit the programs listed below and start from a length of 21, I'll use the following for the smaller sizes:
Length, Score, Program
0, 0
1, 1, +
2, 2, ++
3, 3, +++
Pattern Continues
10, 10, ++++++++++
11, 11, +++++++++++
12, 12, ++++++++++++
13, 16, ++++[->++++<]
14, 20, +++++[->++++<]
15, 25, +++++[->+++++<]
16, 30, ++++++[->+++++<]
17, 36, ++++++[->++++++<]
18, 42, +++++++[->++++++<]
19, 49, +++++++[->+++++++<]
20, 56, ++++++++[->+++++++<]
Total Score: 352
Related but different:
See the comments below for more info.
The combined results so far, being the sum of the best of each size:
length: 50
by l4m2
(262) - 2
length: 49
by l4m2
(212) - 2
length: 48
based on code by l4m2, by alan2here
(172) - 2
length: 39 to 47
based on code by l4m2, by alan2here
Σ (n = 4 to 12) of (fn(0) | f(x) := (4x+2 - 4) / 3)
length: 38
based on code by l4m2, by alan2here
(4^1366 - 4) / 3
length: up to 37 by alan2here
x |
x > 6 ^ 20
x > n
x ≈ n
n = 3,657,880,038,459,860
2
How is this challenge different from Large Numbers in BF ?
– TFeld – 2018-11-15T15:22:11.250The Large Numbers question mentions "byte" several times, everyones answers use and rely on single bytes that wrap, this limits answers to trivial cases capped at 255. The program size of 20 at most also prevents the most optimal answer being anything beyond N, N * N or N * (N + 1). There is then almost no challenge at all. – alan2here – 2018-11-15T20:30:46.423
I think the different parameters of this challenge make it qualitatively different enough. The other question should be closed as dupe. – lirtosiast – 2018-11-15T21:15:59.463
4The other question says
cells which can take on any integer value without overflowing
, though it's impossible to actually get above 255 anyway. This extension seems like a more interesting question (that bans negative positions as well. I don't think eiher should be closed – Jo King – 2018-11-15T22:22:56.3703
There's a close connection between true busy beavers (counting execution time) and largest value computers. Clearly calculating a large value by incrementation implies a long execution, but also a long execution implies the possibility of counting the steps to get a large number. Perhaps the closest previous question is in fact https://codegolf.stackexchange.com/q/4813/194 .
– Peter Taylor – 2018-11-16T23:04:54.533Thanks Peter :) Very Interesting! Thats a hell of large upper limit on program size. :-o Good luck to even attempt that questions busiest beaver. – alan2here – 2018-11-17T10:05:15.400
1Unfortunately, only the last program really counts for anything with the bigger busy beavers, as there's no point adding the smaller programs to the total. It gets to the ppint where the number is so large that doubling or tripling it doesn't really matter – Jo King – 2018-11-21T13:59:19.577
Why move right at the end if it's
the sum of each programs maximum value in memory
? – l4m2 – 2018-11-22T12:01:25.323Thank you :-/ I'll fix this. – alan2here – 2018-11-23T10:33:54.713
@lirtosiast feel free to attempt the best for any size, not just 50. It's interesting where the larger size starts to dominate the score, in the middle of the size range, perhaps at size 26 at time of writing. – alan2here – 2018-11-26T20:19:01.490
@lirtosiast The related and epic busy beaver function grows faster than any computable function, so truly optimal solutions to the sizes here could be ridiculously good. I think based on an answer for another question I've seen here that the ackermann function with a 3 digit rank should be possible easily inside 50 instructions. – alan2here – 2018-11-26T20:48:35.593
1Indeed, I wouldn't be surprised if that were the case. – lirtosiast – 2018-11-26T20:53:23.927
1Does the number have to be in the first data cell? Does the pointer have to end up on the cell where the number is? – Embodiment of Ignorance – 2018-11-28T21:36:08.780
1@EmbodimentofIgnorance I would say no and no, given that neither of those are true for the examples. – lirtosiast – 2018-11-28T23:41:24.693
Yet another similar question: https://codegolf.stackexchange.com/q/155850/39328
– lirtosiast – 2018-12-01T01:58:04.560