Biggest number challenge (Brainfuck)

-3

This is a brainfuck version of Largest Number Printable, and this.


Let's think about brainfuck interpreter such that,

  1. Has array that can be stretched left & right arbitrary large
  2. Each cell can contain arbitrary large integer
    • Can contain negative integer too
  3. When the interpreter starts, every cell is intialized by 0
  4. . prints integer representation of value of cell, then LF.

For example, <<+++.>--. prints

3
-2

, then terminate.


Description

Your goal is to write a brainfuck program that prints a number/numbers. The bigger the number, the more points you'll get.

There are some rules to follow.

  • Your program must terminate.
  • You should not use ,.
  • You can print multiple integers.
  • Your score will be largest number that the program prints.
  • Maximum code length is 1024 bytes. (Only []+-><. counts)

Here is sample brainfuck interpreter that you could test.


Leaderboards

:)

0xrgb

Posted 2018-02-15T09:31:29.790

Reputation: 109

Question was closed 2018-02-15T11:37:59.170

3What's the point in having a separate challenge while such answers can as well be posted to the other challenge? – user202729 – 2018-02-15T09:58:27.937

@user202729 largest number printable challenge's maximum code lengths are 100, and it is quite short for brainfuck. – 0xrgb – 2018-02-15T10:06:11.200

Here's a TIO link for your brainfuck interpreter

– Jo King – 2018-02-15T10:17:52.027

Is there any sort of time limit? – Jo King – 2018-02-15T10:18:45.673

@JoKing There are no time limit for program. But it must terminate. – 0xrgb – 2018-02-15T10:24:07.480

Doesn't really make a difference. Also we havecompressed BF too. – user202729 – 2018-02-15T10:25:26.397

@user202729 Also, this challenge disallows to concatenate string(output). Therefore, we cannot use technique like +........... – 0xrgb – 2018-02-15T10:27:55.693

Well, I watched Jo King 's answer. @user202729 is right. 100 bytes is enough for BF, and there is no point to have a seperate challenge. ~Please mark~ I will mark this challenge as duplicated. – 0xrgb – 2018-02-15T11:34:33.267

Answers

0

Score: 2↑↑45306

Edit: Replaced it with a more modifiable version. Try 2↑↑2, 2↑↑3, and 2↑↑4 (2↑↑5 times out)

Just testing the waters with a short answer.

+>+>++>++>++>++++>++[>[<+++++>-]<<]>
>++<
[
    >[->>+>+<<<]
    >>>
    [
        <[-<+<+>>]
        <[->+<]
        >>-
    ]
    <[-]<<<-
]
>.

The ↑↑ indicate Knuth's arrow notation, where a single ↑, such as X↑Y, means (((X*Y)*Y)*Y)... X times = X^Y, and two ↑↑s means (((X↑Y)↑Y)↑Y)... X times. For example, 2↑↑4 = 2222.

(I'm not familiar with bignum notation, so please tell me if there's a shorter way of representing this, or there's an error in my calculations)

Explanation:

+>+>++>++>++>++++>++[>[<+++++>-]<<]>

Produces the number 45306. (Taken from the brainfuck constants page on Esolangs, an immensely useful page). This will be used as the counter.

>++< 

Sets the current value as two and move back to the counter

[ Loop until the counter is 0

    Square the current value
    >[->>+>+<<<]
    >>>
    [
        <[-<+<+>>]
        <[->+<]
        >>-
    ]<[-]

    Decrement the counter
    <<<-
]

A few ways to extend this:

  • Increase the counter. Pretty easy to do.
  • Increase the initial value. To be simple, you could just set the initial value and the counter as the same number
  • Remove the clear cell in the squaring operation, which compounds the result
  • Create another counter and put another loop around the whole thing
    • This effectively adds another Knuth's Arrow to the result (I think)
    • Further addition, for each iteration of the outer loop, copy the current value to use as the inner loop's counter
    • And then put another loop around the whole lot again.

Jo King

Posted 2018-02-15T09:31:29.790

Reputation: 38 234

1Squaring 2 45306 times only gives you 2^2^45306. – lirtosiast – 2018-12-01T01:57:32.023

@lirtosiast Yeah, I feel kinda stupid looking back at this. I was mixing up $((2^2)^2)^2...$ with $2^{2^{2^{2...}}}$ – Jo King – 2018-12-01T02:55:54.393