Brainf*ck Loop Problem

27 24 bytes

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

Spent a whole day basically writing up a brute forcer and watching the results come in. Now I can get back to doing some actual work... Another day of brute forcing later...

Try it online!

The component ++[<++[++<]>>>+] initialises the tape to

[130, 0, 0, 0, 91, 59, 0]
                       ^

which is just perfect for what we need!


30 bytes

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

Try it online!

85 and 171 are fairly easy to generate in brainfuck (modular inverses of 3 and -3). 85 is pretty close to 90, and 171 is pretty close to 177 (59·3), which is used here. With a bit of hackery, I'm able to produce 88 and 176 instead.

Still one byte short of the target, though.

Other suggestions

In general, it's shorter to iterate over a list, multiplying by a constant, rather than the other way. This is especially true for 3 or more values. For example, this:

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

can be written as:

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

There were only two inner values, so it's not much of an improvement in this case. In fact, just refactoring is one byte shorter:

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

Multiplying 30 by 2 and 3, rather than 10 by 6 and 9. With Martin Büttner's suggestion, this is already down to 38 bytes, without much change to the original:

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

34 bytes

Saved you 11 bytes, but still 5 bytes too long...

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

I've spent hours already, hopefully someone can improve on this.