# "Brainf*ck, but not really."

Yesterday, I organized a contest with various challenges the participants had to solve. I put 6 very simple puzzles that were solved almost instantly, and the deadline was supposed to be until Sunday. So, while the fastest user was figuring out the last puzzle (The hardest one, had to do with reverse-engineering), I made another one. This one made him give up after several hours, and now he's blaming me for torturing him with these challenges.

Before giving the puzzle itself, I must say that the solution to all challenges in the competition was a "flag" with this syntax: ABcD-1234-ABcdEFGhIJ, where letters can be upper- or lowercase, but the dashes stay where they are (They are constant).

Anyways, here's the final challenge.

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


The only hint given was brainf*ck, but not really. (The hint was not actually censored.) Good luck.

• (I had a bunch of comments here pointing out various features of the given text. They were intended to help give ideas to people trying to solve this puzzle. Since I've solved it now, they're redundant and I've deleted them.) Aug 19, 2019 at 13:07

The "flag" is

sIlA-8370-fMUsNOyjMf.

What you need to do:

Run the whole thing as a pseudo-BF program, as follows. You kinda-sorta ignore the "prefix" at the start of each line. Your BF program then generates a bunch of numbers, one for each . operation. Treat these as specifing the positions in a new BF program where the operation in the "prefix" occurs. So e.g. the first few numbers generated are 0,12,13,17, and they are generated by a line starting with +; this tells us to put + operations in positions 0,12,13,17 in the new program we are generating.

Having done this

we get this program: +[--------->++<]>+.-[----->+<]>-.-[-->+++<]>.-[->+++<]>.+[--->++<]>+.+++++++++++.-----.++++.-------.---.-[--->+<]>++.++[---->+++<]>-.++++++++.+[--->+<]>+.++[--->++<]>.+.+[-->+++<]>+.[->+++<]>-.+++++[->+++<]>.>--[----->+<]>.

and

running this program produces the text given at the start of this answer.