@Ra8 if you've corrected my code, note that I had "Use 32 bits on copy.sh/brainfuck" commented  which is a stupid move from me because there's a "dot" in that comment.
It's a bit too late, the results of the Rally were announced on Monday. But yeah, your team (204) was one of the teams who got it correct.
]]>>,[>]
This is a simplified version:
Each digit will be in a cell, so for example reading the input 123, your memory will look like this: 0 49 50 51 0, and the tape will be pointing at the 5th cell. All you have to do now is deduct 48 from each of the non zero cells to get the actual integer value.
After that you have to multiply and add the right most by 1, then by 1*10, then by 1*10*10 etc.. until you reach the 0.
After reaching 0 49 50 51 0, you can go back to the first cell (49) by doing <[<]>, you don't actually need to know how many cells are occupied.
Check @JohnAudi's code first line he did something similar
]]>is , subject to loop? was thinking of something like [,] until empty.
the definition of ',' is to read a single byte from stdin and store it in the current cell.
I don't know how common implemetations behave, but the definition doesn't read the whole stdin.
]]>>[]+[[]>[],[+[[>[]++++++[<>]<<<[>>++++++++++<<]>>[<<+>>]<+>]]]<]
<[>+>+<<]>[>[>+>+<<]>>[<<+>>]<<<]
>>>+++<[>[>+>+<<]>>[<<+>>]<<<]++>>
[>+<]<[]<<[>[>+>+<<]>>[<<+>>]<<<]>>[>><<]>>+++++++++[>>+>+<<<]>>>
[<<<+>>>]<<+>[<>[>++++++++++<[>[>+>>]>[+[<+>]>+>>]<<<<<]>[]++++++++[<++++++>]>
[<<+>>]>[<<+>>]<<]>]<[>>++++++++[<++++++>]]<[.[]<]
Note: You must use a 32Bit cell size for it to work for numbers bigger than 9.
]]>Changing the cell size to 4bytes sounds like a good solution to the problem, but not being standard brainfuck it won't run on standard compilers.
]]>I still struggle to manipulate numbers higher than 255. However assuming very low numbers (like 1 and 2), this is actually a good exercise. I think Johnaudi meant single digit.
@NuclearVision: I don't think your code works. Maybe you miscopied part of it? Why would you start going to the left when you're in cell0?
There are two solutions for removing the limit from 255. You can either have a something like:
[0],[1],[2]
0,3,42
[0] is pointer 0, and has the value of 0.
In [1] you have the value 3, which is in definition, 3 times 255, and in [2] you have 42, so in total the number is: 3*255 + 42 = 802.
Once [1] reaches the limit (255++ == 0) then [0] will have a value added to it.
The other (easier) solution, most compilers (such as http://copy.sh/brainfuck ) have an option to where you can adjust the cell size from 8 Bits (255) to 32 bits.
]]>If not, it should look like this
,[<++>>+>+<<]>[>[>+<<<+>>][+><]<]<<[>+++<]>[<+>]<<[><]>+++++++++
,[<++>>+>+] i start by emptying cell 1, moving n to cells 2 and 3, at cell 30000 i'll have 2n to be used later for substraction
Not exactly. You need to go back to cell 1 before closing the bracket.
if you want to have:
0 on cell1
n on cell 2 and 3
2n on cell 30000
You probably want something like this:
[

<++
>>+
>+
<< # that's the part you're missing.
]
The rest of the reasoning looks legit up front but I have to read it closer.
]]>,[<++>>+>+] i start by emptying cell 1, moving n to cells 2 and 3, at cell 30000 i'll have 2n to be used later for substraction.
>[>[>+<<<+][>+>]] now this is tricky, i move to cell2 which has n right now, start decrementing one point each time while also copying everything from byte 3 to 1, then build n again at byte 3. So if n=4, the following will happen 4 times, substract 1 point from byte 2, add 4 points to cell1, while preserving the multiplier which is 4 at byte 3 everytime the decremention finishes. When 4 subsctractions are made at cell2, cell 1 will have 4*4 or 4^2, cell2 will have nothing left.
<<[>+++]>[<+]<<[>]>+++++++++ Now this takes us back to cell1 which has n^2. substract everypoint and add three to cell2 which was just emptied, then move everything from cell2 to cell1 now we have 3n^2 at cell1, now go to cell30000 keep decr until it's empty while also decrementing cell1. we know that's not gonna cause problems 3n^2 is greater than 2n. Finally add 9 to cell1, which will have your number.
]]>@NuclearVision: I don't think your code works. Maybe you miscopied part of it? Why would you start going to the left when you're in cell0?
]]>