Surprise Party for Brain-Flak

42

3

This question is part of a series Brain-flak Birthday challenges designed to celebrate Brain-Flak's first Birthday. You can find more information about Brain-Flak's Birthday here.

Today is Brain-Flak's first Birthday! So I thought we would throw it a surprise birthday party. So in your favorite language print

Surprise!
Happy Birthday, Brain-Flak!

(Trailing whitespace is permitted)

As always programs should be golfed. However since Brain-Flak programs are made of brackets, it wont count any brackets in your source against you. (The characters ()[]<>{} don't count towards your byte total), but they must be balanced as to not upset Brain-Flak.

Rules

Here is a breakdown of the rules

  • The brackets in your source must be balanced. That is the parentheses of your program must be spanned by the following grammar:

    S -> SS | (S) | [S] | <S> | {S} | E

    where E is the empty string.

    That is to say that a balanced string is either the concatenation of two balanced strings, braces around a balanced string, or the empty string.

  • The score of a program is the number of non-bracket bytes.

  • Your goal should be to minimize your score in whatever language you choose.

  • Standard rules apply so you may write either a complete program or a function.

  • in the event of a tie raw byte count acts as a tie breaker

There are certainly going to be zero byte solutions in certain languages (Parenthesis Hell, Parenthetic, Glypho, Lenguage). Try to find ways to golf well in languages where this is not a trivial task.

Post Rock Garf Hunter

Posted 2017-04-30T13:18:37.153

Reputation: 55 382

8Surprise! Happy Birthday, Brain-Flak! – Comrade SparklePony – 2017-04-30T13:24:41.620

Does it have to be a full program, or can it be a function returning the string? – LegionMammal978 – 2017-04-30T13:41:06.337

I didn't get the "grammar" thing (is this some standard notation?) until told "all brackets must be balanced". – Jonathan Allan – 2017-04-30T14:37:02.767

@johnathanallen It is a context free grammar. I don't know if it is standard but it's the notation I learned in uni. – Post Rock Garf Hunter – 2017-04-30T14:39:10.793

1Sorry for the dumb questions. Is >< considered balanced, or do the braces need to be in the correct order (<>)? – Carcigenicate – 2017-04-30T15:46:57.210

@Carcigenicate >< or ([)] are not balanced. <> or ()[] are. – Post Rock Garf Hunter – 2017-04-30T15:49:03.610

@Christopher I have removed the language restriction due to the tie breaker. However I cannot recommend using any language that can only score zero on this challenge. – Post Rock Garf Hunter – 2017-04-30T19:19:02.503

I cannot recommend using any language that can only score zero on this challenge. Why? Trying to win a competition is pretty much the point of having a competition in the first place. In the future, I'd recommend preventing trivial answers with a perfect score by using a better scoring mechanism. For example, brackets could count as 1 point, other bytes as 10. – Dennis – 2017-04-30T20:53:12.547

@Dennis Its a competition between answers of the same language. You are not trying to beat all the other languages by choosing the language that solves the challenge trivially. Its the same for questions that ask to add two numbers, a bunch of languages are capable of doing so in one byte but that doesn't make the answers interesting. I also think the current scoring mechanism encourages more interesting answers in languages where the task is not trivial in zero bytes. – Post Rock Garf Hunter – 2017-04-30T21:24:56.343

If you're not concerned with comparing scores across languages, why discourage answers with a score of zero? The challenge is basically plain code golf for these languages. – Dennis – 2017-04-30T23:46:53.097

@Dennis Fair enough, with the tie breaker it becomes just code golf. But this challenge is super boring as just a code-golf challenge. – Post Rock Garf Hunter – 2017-05-01T00:09:32.790

2+1 for the CFG. That's a great way to define "balanced." – Brian McCutchon – 2017-05-01T03:28:34.387

Brain-flak was too surprised to participate in the party :( – Matthew Roh – 2017-05-02T16:53:23.367

Answers

22

Python 2, 39 37 36 34 bytes

-1 thanks to dzaima

-2 thanks to Erik the Outgolfer

exec("".join([chr(len(x))for(x)in'()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()({}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()({}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()({}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()({}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()({}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()({}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()({}()()()()()()()()()()()()()()()()({}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()({}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()({}()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()){}()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()){}()()()()()()()()()()()()()()()()){}()()()()()()()()()()()()()()()()()()())'.split("{}")]))

Try it online!

Relevant characters:

exec"".joinchrlenxforxin''.split""

Explanation

This program builds the string:

print"Surprise!\nHappy Birthday, Brain-Flak!"

It does this by converting a long string of parentheses into character codes. Once the string is built it executes it.

It builds the string with the skeleton:

"".join([chr(len(x))for(x)in'<...>'.split("{}")]))

This splits the string along {} and maps each section to the character code corresponding to its length. We can then build the entire string out of parens for a cost of zero bytes.

Post Rock Garf Hunter

Posted 2017-04-30T13:18:37.153

Reputation: 55 382

1Instead of spaces, put () around the x to save 2. – Erik the Outgolfer – 2018-01-25T20:26:03.767

20

Haskell (before GHC 8.4), (10119 7767 7626 7540 bytes), score 15 14 10

(<>)(<><>)(<>)(<<>>)()=(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>)))))))))))))))))))))))))))))))))))))))<<>>(((<>)((<>)((<>)((<>)(<><>)))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>)))))))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)(<><>)))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>)))))))))))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>))))))))))))))))))))))))))))))))))))))))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>)))))))))))))))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>))))))))))<<>>((<><>)<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>))))))))))))))))))))))))))))))))))))))))))))))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>)))))))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>))))))))<<>>(((<>)((<>)((<>)((<>)((<>)(<><>))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>))))))))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>))))))))))))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>)))))))))))))))))))))))))<<>>((<><>)<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>))))))))))))))))))))))))))))))))))))))))))))))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>)))))))))))))))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>)))))))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>))))))))))))))))))))))))))))))))))))))))))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>))))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>)))))))))))))))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>)))))))))))))))<<>>(((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)((<>)(<><>)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))<<>>[])))))))))))))))))))))))))))))))))))))
(<>)'y'pred(:)

Try it online!

The last line defines an anonymous function (<>)'y'pred(:). Call with (<>)'y'pred(:)() to yield the string.

Edit: A huge thanks to @Ørjan Johansen for suggesting to pass the helper functions as parameters instead of declaring them, saving four scoring bytes!

The non-bracket bytes are

=
'y'pred:

How does it work?

A string "wxy" in Haskell is syntactic sugar for a list of characters ['w','x','y'], which again is syntactic sugar for the subsequent construction with the cons operator : and the empty list: 'w':'x':'y':[]. By defining (<<>>)=(:) we yield the same string by writing 'w'<<>>('x'<<>>('y'<<>>[])).

Because chars are ordered, we can compute the predecessor of each char with a function called pred. Using only the char 'y' and pred, the string becomes pred(pred 'y')<<>>(pred 'y'<<>>('y'<<>>[])). By defining (<>)=pred and (<><>)='y' we can represent the string using balanced brackets only:
(<>)((<>)(<><>))<<>>((<>)(<><>)<<>>((<><>)<<>>[]))

However, in the end we don't want a string but a function returning a string, so we define our cons operator as (<<>>) x xs ()=x:xs instead. (Of course with x and xs replaced by identifiers using balanced brackets only: (<<>>)(<>)(<><>)()=(<>):(<><>)). This way,

((<>)((<>)(<><>))<<>>((<>)(<><>)<<>>((<><>)<<>>[])())())

is a function of type () -> String and appending a final () yields the original string:

((<>)((<>)(<><>))<<>>((<>)(<><>)<<>>((<><>)<<>>[])())())()

Using this method we achieve a solution with score 15. However, we can condense the three declarations into one by declaring a function which takes four arguments: 'z', pred, (:) and () for calling.


The following function encode encodes a string with chars smaller or equal to 'y' in this way: (Why y? Because it's the largest char in "Surprise!\nHappy Birthday, Brain-Flak!" and thus yields the shortest representation. Thanks again to Ørjan Johansen for pointing this out.)

c x = let l = fromEnum 'y' - fromEnum x  
      in "(" ++ ([1..l]>>"((<>)") ++ "(<><>)" ++ ([1..l]>>")") ++ "<<>>" 
encode s = concatMap c s ++ "[]" ++ ([1..length s-1]>>")()") ++ ")"

Try it online!

Laikoni

Posted 2017-04-30T13:18:37.153

Reputation: 23 676

Oops, didn't check for new posts before editing my own... and you got another byte by going in the opposite direction! – Ørjan Johansen – 2017-05-01T20:28:50.840

Rolled back my edit. – Ørjan Johansen – 2017-05-01T20:41:19.580

Since 'z' doesn't actually occur in the goal string, I think you can reduce the byte count tie breaker by using 'y' instead. – Ørjan Johansen – 2017-05-02T00:07:14.757

The outermost sets of parentheses are redundant, both for the whole string and for each character. (Getting this right was about the hardest thing in my near-duplicate. (Watch out for the 'y's if you do the other change.)) – Ørjan Johansen – 2017-05-02T00:31:57.553

@ØrjanJohansen I changed 'z' to 'y' and also managed to save a scoring byte. I have to look at it later whether still some brackets can be saved. – Laikoni – 2017-05-02T06:00:58.933

1Ooh, nice trick, I was wondering about how to make it anonymous. But that gives me another idea: You can save 4 more bytes by making the helper functions parameters. I.e. (<<<>>>)(<><>)(<>)(<<>>)()=...;(<<<>>>)'y'pred(:) – Ørjan Johansen – 2017-05-02T10:09:36.200

1

Um, two bytes, not four. Try it online!

– Ørjan Johansen – 2017-05-02T10:17:06.127

Actually Haskell doesn't require the parameters of a function to be differently named from it (only from each other), so you can use <> for the top level function. – Ørjan Johansen – 2017-05-02T13:56:06.440

@ØrjanJohansen Great idea with the parameters! I'll update the post as soon as I'm home. – Laikoni – 2017-05-02T14:40:41.677

@ØrjanJohansen Why only two bytes instead of four? I count 10 remaining bytes. – Laikoni – 2017-05-02T20:57:03.587

I counted them by pasting from TIO to vim and removing the brackets - I think I forgot to remove the f=. – Ørjan Johansen – 2017-05-02T21:03:27.103

Purged some parentheses. (basically every char except the ys had an extra pair.) – Ørjan Johansen – 2017-05-02T21:25:28.293

Since GHC 8.4, <> is a Prelude operator, so: (1) This now breaks in recent Haskell. (2) However, it should be relatively easy to use the Prelude <> instead of :, to get a score of 9. – Ørjan Johansen – 2018-12-02T10:12:21.947

@ØrjanJohansen Thanks for pointing out! I added a new answer to avoid cluttering this one even further: https://codegolf.stackexchange.com/a/177945/56433

– Laikoni – 2018-12-22T12:26:18.920

12

Jelly, 7 6 bytes

“”Lb⁹Ọ

Inside the “” you need to put the output of this Jelly program:

⁾()Ȯ“cWṪḂÇa'ỴOḞḊʂFGĖƓẋ0Ɗ/⁷ẓƊĖṘḲ"ÇẈW'ⱮḟėıḲ7¿’¡

-1 byte thanks to Jonathan Allan (allowed trailing newline)

There are 53127666317289661939246122975355844970973062889031671423309402549417051416384149‌​80886139013 (we'll call this n) ()s between “”.

Explanation:

“”Lb⁹Ọ ḷ“Main link. Arguments: 0”
“”     ḷ“String containing n pairs of round brackets”
  L    ḷ“Take its length”
   b⁹  ḷ“Convert to base 256 (ints representing digits)”
     Ọ ḷ“Convert char codes to chars”

Erik the Outgolfer

Posted 2017-04-30T13:18:37.153

Reputation: 38 134

Good one Erik :) – Jonathan Allan – 2017-04-30T14:45:42.880

so this one doesn't really work in practice, right? – Display Name – 2017-05-28T18:33:37.657

1@SargeBorsch Practice? Nah, who cares about practice? – Erik the Outgolfer – 2017-05-28T18:37:32.583

12

Retina, 59 - 24 = 35 bytes


Su{p()se!¶Ha<<>[]i{thd}>,[](a)n-Fl}k!
T`<>()[]{}`\pyri Bra

Try it online! By comparison, the boring solution takes 38 bytes.

Neil

Posted 2017-04-30T13:18:37.153

Reputation: 95 035

1Wow, that's a very clever compression method for this challenge. Have a +1 :-) – ETHproductions – 2017-04-30T19:38:33.867

11

Lenguage, 0 bytes

Just 10024793746353848520175158940670214213802394805963081469362831141755126591573942436182287015467334956253918417576118983828148929806934751198148656645940502264502520032312455157880058174845907554602116807351044784410936407102892289953027884533102082518964744402664917253792543505897552998982122997648280947470217067174451441654554437678556775097996646071948 bytes made of balanced brackets.

Python 3 program to generate my favorite version, given enough time and memory:

for i in range(0x4e24a0fa26624a0fa00084984c021249249800000004000c5001f509c4941f5312507d18062800007d4c494000fa10e0112497d4800000021c49283e80831403ea1c4941f44c000000100849249249309261260c4941f400871280003ea124924924c18a01f50938924a0fa30018a003e80800000100004c492500fa10625001f421389283ea124924926000000010601125f46):print(end='()')

Erik the Outgolfer

Posted 2017-04-30T13:18:37.153

Reputation: 38 134

1Huh? Why the downvotes? This answer is valid. The question doesn't explicitly forbid answers in trivial languages, it just encourages you to write it in a language where it would be non-trivial. – Erik the Outgolfer – 2017-04-30T14:14:38.237

15It's boring as hell though. It should be pretty obvious why it's been downvoted. Just because it's valid doesn't mean it's not boring or an abuse of the rules. – Rɪᴋᴇʀ – 2017-04-30T14:17:19.343

@Riker Well, someone had to post it anyways, only Brain-Flak variants are disallowed. – Erik the Outgolfer – 2017-04-30T14:19:13.423

yes, I don't mean to say it's not valid. It still can be a bad answer though. – Rɪᴋᴇʀ – 2017-04-30T14:19:47.553

@Riker I just asked because I'm inexperienced with Lenguage, and it's questionable whether this is actually valid. – Erik the Outgolfer – 2017-04-30T14:20:32.707

well, it could be considered invalid under "not golfed", as the BF code it translates to would be significantly shorter, but I dunno about that. – Rɪᴋᴇʀ – 2017-04-30T14:22:29.457

Pretty sure the brainfuck code behind this is not golfed, probably generated using a bunch of +'s, but I won't bother to confirm. – Leaky Nun – 2017-04-30T14:29:13.833

@LeakyNun I used this tool to compress the BF code, it's not just a bunch of +'s, but this is Lenguage, so the number is too large.

– Erik the Outgolfer – 2017-04-30T14:32:09.567

Alright, it's valid then (but that doesn't mean I'll retract my downvote). – Leaky Nun – 2017-04-30T14:33:38.677

@LeakyNun I never asked you to retract it :) – Erik the Outgolfer – 2017-04-30T14:35:32.757

11814382933791978604180811513276951596891496241887282518341046923729565882935872511161361237442639477201197909462276216213505390716388781699995156144914006643460505208562917269884967739569849775334582997489357826941308223133279896950569038552439752566374191225909282002406578832005197375356729715483875184532677626663572228849651637974329845225525069790860 brackets works better for less bytes – Christopher – 2017-05-04T23:02:15.557

5I golfed a few trillion bytes off. Nothing much – Christopher – 2017-05-04T23:03:23.893

@Christopher Can you give me a link to the original BF script so that I can test it? – Erik the Outgolfer – 2017-05-05T10:20:12.917

@EriktheOutgolfer I only really golfed 2 bytes off the program. At the beginning it did +-- and I fixed it to - – Christopher – 2017-05-05T11:34:18.453

@Christopher Huh? I don't think it did that. Anyways, I'll update soon. – Erik the Outgolfer – 2017-05-05T11:38:01.307

@Christopher It seems like the code you have is my number and not yours though. – Erik the Outgolfer – 2017-05-05T11:50:34.530

@EriktheOutgolfer what? How did that happen – Christopher – 2017-05-05T12:39:23.570

Let us continue this discussion in chat.

– Erik the Outgolfer – 2017-05-05T12:41:06.873

9

Haskell, (12006 13485 bytes), score 18 17

EDIT:

  • -1 byte: Got the toEnum version to work without extensions by moving the toEnum to the main function, at the cost of a $.
  • -1 byte, then +1 again: If you look in the edit history, you'll see I changed to something completely different. And only later did I check the other answers and see that @Laikoni had done almost the same idea one hour earlier, and got it a byte better! So I rolled back to my earlier method.

Use as putStrLn$(<<>>)().

(<<>>)<>(<<<>>>)=length(<<<>>>):(<<>>)
(<<>>)()=toEnum<$>...

Try it online!

where ... is the result string of the following expression:

convert="[]"++concat["<>([]"++([1..fromEnum c]>>"<>[]")++")"|c<-reverse"Surprise!\nHappy Birthday, Brain-Flak!"]

The only non-balanced characters are

=length:
=toEnum$

The following variant (13484 bytes) has score 16 except that it needs GHC's ExtendedDefaultRules extension, and so only works in GHCi by default. (Unless you like heaps of warnings, you also want -fdefer-type-errors and -Wno-deferred-type-errors for some reason.)

(<<>>)<>(<<<>>>)=toEnum(length(<<<>>>)):(<<>>)
(<<>>)()=...

Try it online!

How it works

  • Haskell allows defining your own (multi-character) operators, and <> are legal operator characters. Moreover, if parenthesized, these can be used for any value, not just two-argument functions.
  • (<<>>) on the second line is the main function, it takes a single dummy argument () and returns the final string.
  • The operator <> takes two lists and prepends the length of the second to the first (in the second version, also first converting the length to a character.) Operators are left associative by default, so this chains easily.
  • A list of any length can now be constructed by chaining empty lists [] with <>.
  • The final string can now be constructed by chaining lists whose lengths encode the desired characters – this uses only balanced ()<>[] characters – and then (in the main version) mapping toEnum over the resulting list.

Ørjan Johansen

Posted 2017-04-30T13:18:37.153

Reputation: 6 914

Wow! This is quite impressive – Post Rock Garf Hunter – 2017-04-30T21:38:27.120

8

Haskell, (1965 3131 18073 bytes), score 31 23 19

(<>)=(:)
(<<>>)=['\n'..]
(((<<><>>):(<<<>>>))<<>><>([()]:(<><>)))()=(<<><>>)<>(((<<>>)<<>><>(<><>))())
(((<<><>>):(<<<>>>))<<>><>((<><><>):(<><>)))()=((<<<>>>)<<>><>(<><>))()
f=(<<>>)<<>><>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([]<>([()]<>([])))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

Try it online! Usage: The last line is an anonymous function. Bind it to e.g. f and call with f().

The 19 non-bracket bytes are

=:
='\n'..
::=
::=

plus a trailing newline.


Score 23 version (3131 bytes):

(<<>>)=['\n'..]
(('{'{-}-}:(<><>))<>((<<><>>):(<<<>>>)))()=(<<><>>):((<><>)<>(<<>>))()
(((<><><>):(<><>))<>((<<><>>):(<<<>>>)))()=((<><>)<>(<<<>>>))()
"[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][{}][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][{}][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][{}][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][]{{}}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][{}][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][{}][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][{}][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][{}][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][{}][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][{}][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][{}][][][][][][][][][][][][][][][][][{}][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][{}][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][{}][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][{}][][][][][][][][][][][{}]"<>(<<>>)

Try it online! The 23 non-bracket bytes are

='\n'..
''--::=:
::=
""

Score 31 version (1965 bytes):

(<<>>)=['\n'..'~']++(<<>>)
putStr[(<>)|('{'{-}-},(<>))<-zip">[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][{}][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][{}][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][{}][][][]{}[][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][{}][][][]{}{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][{}][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][{}][][][][][][][][][][][][][][][][{}][][][][][][][][][][][][][][][][][][][][][][][{}][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][{}][][][{}][]{}[][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][{}][][][][][][][][][][][][][][][][][][{}][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][{}[][][][]{}][][][][][][][][][][][][][][][][][][][][]{}"(<<>>)]

Try it online!

After all brackets are stripped, these 31 bytes remain:

='\n'..'~'++
putStr|''--,-zip""

How does it work?

['\n'..'~'] yields the list of all characters from newline to ~ which includes all printable ASCII chars. (<<>>) is an identifier chosen to have zero bytes under the given scoring rule. (<<>>)=['\n'..'~']++(<<>>) thus yields an infinite repetition of the list of chars.

In the second line zip"> ... "(<<>>) zips a long string of brackets with the infinite string, yielding a list of tuples with a bracket char in the first component and some ASCII char in the second. For each tuple in this list we check if it matches the pattern ('{'{-}-},(<>)), that is whether it has a { bracket as first component. {- ... -} is an in-line comment in Haskell, so '{'{-}-} is a balanced version of '{'. If the match is successful the second component of the tuple is bond to the identifier (<>) and added to string build via the list comprehension. Finally putStr prints the string. putStr[(<>)|('{'{-}-},(<>))<-zip"> ... "(<<>>)]


Directly printing the string is 46 bytes:

putStr"Surprise!\nHappy Birthday, Brain-Flak!"

Laikoni

Posted 2017-04-30T13:18:37.153

Reputation: 23 676

It looks like you included <> as non-bracket bytes. – Brian Minton – 2017-05-01T13:37:09.600

@BrianMinton Thanks for noticing! There should have been a trailing newline instead. – Laikoni – 2017-05-01T14:28:31.297

8

Japt, 19 14 13 10 9 8 bytes

"(()()...()()<"q>)m(l)m(d)q

where the string at the beginning is:

(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()<>()()()()()()()()()()()()()()()()<>()()()()()()<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()<>()()()()()()()()()()()()()()())<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()<>()()()()()()()()()()()()()()()()()()()()())<>()()()()()()()()()()()()()()()(<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())<>()()()()()()()()()()()()()()()()()()()()()()<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()<>()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()<>()()()()()()()()()()()()()()()()<

The total byte count is "only" 6694 3394 3354, so you can try it online!

Explanation

The actual method used is explained in other answers: Split on <>, map each run of parens to chr(len(x)), join again on the empty string. Here, it's the golfing that's the fun part.

Before "golfing", the original code might look like

"..."q"<>" mZ{Zl d} q""

which is a quite literal description: "...".split("<>").map(Z => Z.length.toChar()).join("") Now we need to minimize non-bracket chars. How? Well, first we can do some actual golfing:

"..."q"<>" ml md q

This roughly represents "...".split("<>").map(Z => Z.length).map(Z => Z.toChar()).join().

Now we can abuse the confusing way Japt treats parentheses. ( represents going up one level, as in most languages, but ) represents going down two levels (a space goes down one level), which means we can optimize the code to:

"..."q("<>")m(l)m(d)q

This code acts just the same as the above, but uses two fewer non-bracket chars.

Additionally, if an operator is the first input to a function, it gets turned into a string so that the function can decide what to do with it. This means that we can avoid the quotes if we just make every run of parentheses 1 byte shorter, and split on > instead (with some clever arrangement to cancel out the resulting >) in the code):

"(...<"q>)m(l)m(d)q

This saves us a further two bytes, since we took out two of the quotation marks.

ETHproductions

Posted 2017-04-30T13:18:37.153

Reputation: 47 880

6

HTML, 37 Bytes

Surprise!<p>Happy Birthday, Brain-Flak!

Surprise!<p>Happy Birthday, Brain-Flak!

Jörg Hülsermann

Posted 2017-04-30T13:18:37.153

Reputation: 13 026

1You could use a <br> tag like this: Surprise!<br>Happy Birthday, Brain-Flak! – Loovjo – 2017-04-30T14:02:06.007

@Loovjo <br> is one byte longer as <p> I have try it before posting. It looks a little bit nicer. I use no closing tag – Jörg Hülsermann – 2017-04-30T14:09:19.297

1Ok. I don't think you need the first <p> though. – Loovjo – 2017-04-30T14:11:27.067

@Loovjo Yes this is correct I can drop it Thank You – Jörg Hülsermann – 2017-04-30T14:45:10.420

... I don't think HTML counts as a programming language though – Luke – 2017-04-30T17:10:43.960

3

@Luke The consensus is that kolmogorov-complexity challenges don't require a programming language. (And HTML can act as a wrapper for JS anyway.)

– Arnauld – 2017-04-30T17:27:39.310

5

05AB1E, 24 bytes

…·»!
™”ŽØ¢©,žÞ”"-Flak!"J

Uses the 05AB1E encoding. Try it online!

Adnan

Posted 2017-04-30T13:18:37.153

Reputation: 41 965

5

Pyth, 4⃠ 3⃠ 2 bytes

Crossed out 4 is not regular 4 if you use zalgo Unicode magic

Thanks to Roman Gräf and Neil for saving 1 byte.

The code is Cl(()()()()()()) where the outer parenthesis contains 41505989310382548390036033574496753883572705382055993299460470741732071419050117038172961 concatenated copies of (). (Stack Exchange did not allow me to post the full code.)

Creates a tuple (()) of empty tuples (()), takes the length (l) and converts it to a base-256 string (C).

PurkkaKoodari

Posted 2017-04-30T13:18:37.153

Reputation: 16 699

Is there any need for h cant you just add another pair of brackets? – Roman Gräf – 2017-04-30T19:20:34.413

2@RomanGräf I think he needs the result to be an odd number. – Neil – 2017-04-30T19:21:44.860

1@RomanGräf The required base-256 number is odd, and the string needs to be balanced (and thus even-length), so this should be the optimal score. – PurkkaKoodari – 2017-04-30T19:21:50.980

You know, you could shift the h two positions to the right and it would still work perfectly ;-) – ETHproductions – 2017-04-30T19:22:20.103

Actually, you're allowed to add a trailing \n - that would make it an even number. – Neil – 2017-04-30T19:24:23.517

@ETHproductions Yes, but this one felt like a cleaner solution. Another valid solution would be Ctl" and adding one more pair. – PurkkaKoodari – 2017-04-30T19:24:32.883

@Neil Unfortunately, Pyth prints the newline automatically. That could be removed by prepending p, eliminating the improvement. (Edit: apparently trailing whitespace is allowed, changing) – PurkkaKoodari – 2017-04-30T19:25:21.187

Starting a new trend I see – Christopher – 2017-04-30T23:19:11.933

&nbsp; will work for more people than 0x20e0. – Jonathan Allan – 2017-05-01T05:43:52.943

1"Stack Exchange did not allow me to post the full code." - you have the full code?! – Jonathan Allan – 2017-05-01T05:44:34.990

So, why does this not print Hi?

– Jonathan Allan – 2017-05-01T05:53:06.883

@JonathanAllan C is a general int to string converter. It converts an int to a single unicode character if the input is a unicode codepoint, or to the base 256 encoded string if it's not. – isaacg – 2017-05-01T07:52:06.983

@JonathanAllan I know NBSP is more commonly supported, but I saw that already used ;) – PurkkaKoodari – 2017-05-01T08:07:53.630

5

Japt, 6687 bytes, score 5

(([[[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]][[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]]]ml)md)q

Try it online!

This is in a similar vein as my other Japt answer, but it uses nested arrays instead of a string. The nice things about nested arrays (besides the fact that defining them doesn't take any bytes) is that they're pre-organized, so you don't have to do any fancy split-on-<> magic, or decode from a huge base 256 number, or anything like that. The actual logic is just .map(X => X.length).map(X => String.fromCharCode(X)).join("").

ETHproductions

Posted 2017-04-30T13:18:37.153

Reputation: 47 880

4

Chip, 553+3 = 556 bytes, score 127+3 = 130

((<>)ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZt()(((((((((((((((((((((((((((
((()))))))))xx)))))x))))))))xx)))))x))))xg()((((((((((((((((((((((((((((((((({
*})<>))))))))xx)))))x)))))))))x)))))x))))f)*{((((((((((((((((((((((((((([
Z<>])xxxx)x)))))xxx)))xx)))x)))x)))))))))))}e{((((((((((((((((((((((((
((())))))x)))xx)))x))x))x))xx))))xxx)x)x)))}d{((((((((((((((((((((((((((((
((())x)))))x)))))))))))x)x))x)))))xxxx)))))}c{((((((((((((((((((((((((
(((())x)x)x))x))))))x)x)))))))xx))x)x))x)))}b{(((((((((((((((((((
(((()x)))xxxx))x))x))x))))xx))))xx)x))xxx))}a

+3 for arg -w. Try it online!

The non-bracket bytes are

ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZt
xxxxxxxg
*xxxxxf*
Zxxxxxxxxxxxxe
xxxxxxxxxxxxxd
xxxxxxxxxc
xxxxxxxxxxxb
xxxxxxxxxxxxxxxxa

Ungolfed/unbalanced:

*}vZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZt
Z'))))))))xx)))))x))))))))xx)))))x))))xg
  x))))))))xx)))))x)))))))))x)))))x))))f
  )))))x)xxxxx)))xxx))xxx)xxx)xxxxxxxxxe
  xxxxx)xxx))xxx)xx)xx)xx))xxxx)))x)x)xd
  x)xxxxx)xxxxxxxxxxx)x)xx)xxxxx))))xxxc
  )x)x)x)xx)xxxxxx)x)xxxxxxx))xx)x)xx)xb
  ))xxx))))xx)xx)xx)xxxx))xxxx))x)xx)))a

As you can see, the original code uses only right-side brackets, so all left-side brackets are for balancing only. In the course of coming up with this solution, I found a much denser string representation in Chip the I had had for my previous answers e.g. hello world, and so I've updated those as well.

How it works:

The bit hanging off the left produces a 1-cycle pulse to get things started. This pulse travels along the Z's at a rate of 1 per cycle, which provides the timing. When each Z is powered, it's corresponding column produces the ascii code of the character at that index, which then gets output by the elements a through g (one per bit of the output byte, except the high bit h which is always 0). When finished, the t terminates execution.

The ascii encoding is straightforward: ) means 1 and x means 0. However, the bottom 5 rows are mostly x, so I invert those bits in the final solution, effectively swapping the two symbols.

Is this the best possible score?

I doubt it. At the absolute minimum, I think we need the following: 1 each a through g, since those are the active output bits, 1 * or similar to provide a starting signal, 1 t to terminate execution, 36 Zs or zs to time out each letter, and the command arg -w. This all sums to a score of 48.

Above that theoretical minimum, my solution has 7 newlines, a second *, an extra Z, and 73 xs.

Phlarx

Posted 2017-04-30T13:18:37.153

Reputation: 1 366

4

C, 9265 bytes, score 37

i;f(){for(i=0;putchar(i+=strspn("[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[<[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[<[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[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]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>]>]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]"+i,"[]")+1););}

See it work online.

C, 8589934626 bytes, score 34

i;f(){for(;putchar(i+=strspn("STRING"+i,"[]")+1););}

Where STRING is the same large string literal as used in the above example, except that it has two differences in the very middle of the string where there is a substring <>. Just before <, are 4294962688 additional [ characters, and just after > are 4294962688 additional ] characters.

The program will work under the following assumptions:

  • INT_MAX is 2^31-1, and INT_MIN is -2^31.

  • Compiled with wrapping behavior for signed arithmetic. (-fwrapv)

  • Function strspn is capable of processing 4294962689 characters at a time.

  • Compiler is capable of compiling a string literal composed of 8589934592 characters.

Those assumptions are possible on modern 64 bit architectures, where type int is 4 bytes and type size_t is 8 bytes. The function strspn returns type size_t, and the same type is related to the internal limit for maximum object size. Type size_t being 8 bytes would satisfy the last two assumptions.

This difference in this version is that variable i doesn't have to be reset to 0, since it wraps around to 0 after the last character is printed.

2501

Posted 2017-04-30T13:18:37.153

Reputation: 748

3

Haskell, 9735 bytes, score 9

'y'<<>>pred
(<><>)<<>>(<<>>)=[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>))))))))))))))))))))))))))))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)(<><>))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>)))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>)))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>)))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>))))))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>))))))))))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>)))))))))))))))))))))))))))))))))))))))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>))))))))))))))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>)))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>)))))))))]<>[(<><>)]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>)))))))))))))))))))))))))))))))))))))))))))))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>))))))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>)))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>)))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>)))))))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>)))))))))))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>))))))))))))))))))))))))]<>[(<><>)]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>)))))))))))))))))))))))))))))))))))))))))))))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>)))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>))))))))))))))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>))))))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>)))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>)))))))))))))))))))))))))))))))))))))))))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>)))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>))))))))))))))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>))))))))))))))]<>[(<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)((<<>>)(<><>))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))]

Try it online!

The 9 scoring bytes are

'y'pred
=

This works in current versions of Haskell (GHC 8.4 or newer) where (<>) is in Prelude. Thanks to Ørjan Johansen for pointing out that this breaks my previous solution but allows to save another scoring byte.

Explanation

As (<>) on two lists is the same as (++), we can represent a string "abc" as "a"<>"b"<>"c" instead. Strings are lists of characters, so ['a']<>['b']<>['c'] denotes the same string. Now, as in the previous answer, we only want a single character literal, so we stick with he highest one 'c' and represent the others as predecessors of it: [pred(pred 'c')]<>[pred 'c']<>['c']. Finally, by replacing 'c' with (<><>) which is a valid identifier and pred with (<<>>), we get an encoding of the string "abc" that only consists of balanced parenthesis: [(<<>>)((<<>>)(<><>))]<>[(<<>>)(<><>)]<>[(<><>)].

The following function encodes an arbitrary string in this manner:

f s = show max_char ++ "<<>>pred\n(<><>)<<>>(<<>>)=" ++ encode s
    where
        max_char = maximum s
        s `unless` b = if b then "" else s

        encode [] = ""
        encode (x:r) = 
            let repl = ([succ(succ x) .. max_char] >>)
            in ""
               ++ "[" 
               ++ repl "(<<>>)(" 
               ++ "(<<>>)" `unless` (x == max_char)
               ++ "(<><>)" 
               ++ repl ")"
               ++ "]" 
               ++ "<>" `unless` (r == "")
               ++ encode r

Try it online!

Laikoni

Posted 2017-04-30T13:18:37.153

Reputation: 23 676

Because (<<>>) is used so many times, I think it will save a lot of bytes if you swap its name with that of <> (by passing the latter as an extra parameter). – Ørjan Johansen – 2018-12-22T16:50:31.333

2

C, 69 64 bytes

Try Online

f(s,t)char*t;{if(*t)*t-123||putchar(s),f(s+(*t==60)-(*t==91),t+2);}
main(){f(83,"{}<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>{}[][][]{}[][]{}<><>{}[][][][][][][][][]{}<><><><><><><><><><>{}[][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][]{}<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>{}<><><><><><><><><><><><><><><><><><><><><><><><><>{}<><><><><><><><><><><><><><><>{}{}<><><><><><><><><>{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>{}<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>{}<><><><><><><><><>{}<><>{}[][][][][][][][][][][][]{}[][][][]{}[][][]{}<><><><><><><><><><><><><><><><><><><><><><><><>{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][]{}<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>{}<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>{}[][][][][][][][][][][][][][][][][]{}<><><><><><><><>{}<><><><><>{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}<><><><><><><><><><><><><><><><><><><><><><><><><>{}<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>{}[][][][][][][][][][][]{}<><><><><><><><><><>{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}");}

How I did it

p(int x){putchar(x);}
j;f(char*t){ p(t[0]); for(int i=1; t[i]; i++){ j=t[i]-t[i-1]; while(j>0)p('<'),p('>'),j--; while(j<0)p('['),p(']'),j++; p('{'),p('}'); }}
  • Next I replaced * with {}, > with <>, and < with [] so they don't count, so now this code count is 1 because of the starting character S.
S<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>{}[][][]{}[][]{}<><>{}[][][][][][][][][]{}<><><><><><><><><><>{}[][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][][][][][][][][][][][][]{}<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>{}<><><><><><><><><><><><><><><><><><><><><><><><><>{}<><><><><><><><><><><><><><><>{}{}<><><><><><><><><>{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>{}<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>{}<><><><><><><><><>{}<><>{}[][][][][][][][][][][][]{}[][][][]{}[][][]{}<><><><><><><><><><><><><><><><><><><><><><><><>{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}[][][][][][][][][][][][]{}<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>{}<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>{}[][][][][][][][][][][][][][][][][]{}<><><><><><><><>{}<><><><><>{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}<><><><><><><><><><><><><><><><><><><><><><><><><>{}<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>{}[][][][][][][][][][][]{}<><><><><><><><><><>{}[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]{}
  • Finally I wrote a parser, which just sum on <>, subtract on [], print current sum on {}, and terminates on the end of the string \0.

C, 49 bytes Try Online

main(){puts("Surprise!\nHappy Birthday, Brain-Flak!");}

Khaled.K

Posted 2017-04-30T13:18:37.153

Reputation: 1 435

1Can't you in-line p to save some bytes? – Laikoni – 2017-05-02T21:10:01.183

2

C# Interactive, 45 Bytes

"Surprise!\nHappy Birthday, Brain-Flak!"

I know, it's kind of boring, but if executed in the C# interactive, it produces the desired output - and actually I doubt there's a smaller way to solve this in C#.

However, there is a more stilful way:

var a=new BitArray("[][]()()[]()[]()[]()[]()[][][]()()[]()()[][][]()()()()()[][][]()()[]()()[][][]()[]()()[]()[][]()[][]()()[][][]()[]()[]()()[][]()[]()()()()[]()()()[]()[]()()()()()()()[]()()[]()[]()()()()[][]()()()()()[][][]()()()()()[][][]()[]()()[][][][]()()()()()()[]()()()[]()()()()[]()[]()()[]()[][]()()[]()()[][][]()()()[]()[][][]()()()()[]()[][]()()()[]()()[][]()[]()()()()[][]()[]()()[][][][]()()()[][]()[]()()()()()()()[]()()()[]()()()()[]()()[]()()[][][]()[]()()()()[][]()[]()()[]()[][]()()[][][]()[][]()[]()[][]()[]()()()[][]()()()[]()()()[][]()[][]()[]()()()()[][]()[][]()[]()[][]()[]()()()()[]()()".Replace("()","0").Replace("[]","1").Select(/*<*/s=>s=='1').ToArray());var b=new byte[a.Count];a.CopyTo(b,0);Console.Write(Encoding.UTF8.GetString(b));

But this is 145 Bytes big.

With line breaks it looks like that:

var a = new BitArray(
    "[][]()()[]()[]()[]()[]()[][][]()()[]()()[][][]()()()()()[][][]()()[]()()[][][]()[]()()[]()[][]()[][]()()[][][]()[]()[]()()[][]()[]()()()()[]()()()[]()[]()()()()()()()[]()()[]()[]()()()()[][]()()()()()[][][]()()()()()[][][]()[]()()[][][][]()()()()()()[]()()()[]()()()()[]()[]()()[]()[][]()()[]()()[][][]()()()[]()[][][]()()()()[]()[][]()()()[]()()[][]()[]()()()()[][]()[]()()[][][][]()()()[][]()[]()()()()()()()[]()()()[]()()()()[]()()[]()()[][][]()[]()()()()[][]()[]()()[]()[][]()()[][][]()[][]()[]()[][]()[]()()()[][]()()()[]()()()[][]()[][]()[]()()()()[][]()[][]()[]()[][]()[]()()()()[]()()"
        .Replace("()", "0")
        .Replace("[]", "1")
        .Select(/*<*/s => s == '1')
        .ToArray());
var b = new byte[a.Count];
a.CopyTo(b, 0);
Console.Write(Encoding.UTF8.GetString(b));

This interprets the brackets as boolean values and then as a string.

Actually I'm not an advanced code golfer, so any suggestions are appreciated!

MetaColon

Posted 2017-04-30T13:18:37.153

Reputation: 391

You need to close the bracket in .Select(s => to comply with S -> <S>, you could change it to .Select(/*<*/s => – Khaled.K – 2017-05-01T09:39:35.193

Also your solution is a code-snippet, it needs to be a complete program that can be compiled as-is – Khaled.K – 2017-05-01T09:43:00.513

@Khaled.K Actually it can be compiled, using the C# interactive – MetaColon – 2017-05-01T10:28:55.943

1You should then distinguish it from a normal C# program, maybe change the title to C# Interactive, also I think it's interpreted in C# interactive, not compiled, but it's still considered a program\script – Khaled.K – 2017-05-01T10:32:03.343

2

CJam, 6683 bytes, score 3

[(a lot of square brackets omitted)]{,c}%

I shortened the code here to not clutter up the page too much. You can see the full code in the TIO link. The only non-bracket characters are ,c%.

Try it online!

Explanation

The program starts by pushing an array of arrays of empty arrays. Each sub array contains a number of empty arrays corresponding to an ASCII value of a character in the desired string. Then for each subarray ({...}%), it gets the length of the array (,) and casts that length to a character (c).

The resulting string is implicitly printed.

Business Cat

Posted 2017-04-30T13:18:37.153

Reputation: 8 927

2

Lua 5.3, 108097107033101 bytes, score 28 27

load(([[REPLACE]]):gsub([[[<>]-{()}]],[[%1]]):gsub([[...]],([[]]).char))()

Here, REPLACE is replaced by a length 108097107033034 string of free characters. The string encodes data by putting {} at certain key positions. The first gsub will replace the string by the indices of the {}s (via the empty capture group ()). The second gsub breaks this resulting string into 3-digit blocks and replaces each block by its ASCII representation.

Note that the syntax for raw strings in Lua is (basically) [[string contents]], which is quite useful in reducing the score.

The (unescaped) string I'm generating is print"Surprise!\nHappy Birthday, Brain-Flak!". Replacing each character with its 3-digit decimal ASCII code gives 112114105110116034083117114112114105115101033092110072097112112121032066105114116104100097121044032066114097105110045070108097107033034. The code I use can only generate sequences of increasing natural numbers (at least 2 apart) that don't start with initial zeroes. So, this number gets split into 11, 2114, 105110, 1160340, 83117114, 112114105, 1151010330, 9211007209, 71121121210, 320661051141, 1610410009712, 10440320661140, 97105110045070, 108097107033034. (This last number is exactly the length of the REPLACE value, as the last match of the pattern will give the index of the final }, noting that Lua-indices start at 1. If the last number was odd, then the pattern and string would have to be modified slightly, although it's not hard.)

I didn't actually generate and run this program because it is too big (although it theoretically could work on a 64-bit machine, it wouldn't fit on my hard drive).

As a proof of concept, here's a small program that prints 3 using the same principle:

p=print
load(([[<<><><><>{}<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>{}<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>{}><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>{}]]):gsub([[[<>]-{()}]],[[%1]]):gsub([[...]],([[]]).char))()

This generates the code string p"3" via the number 112034051034 via the split 11, 203, 405, 1034.

tehtmi

Posted 2017-04-30T13:18:37.153

Reputation: 446

2

Pip, 6681 bytes, score 3

C#*[[()()...()]...[()()...()]]

(with a lot of parentheses and some square brackets redacted). Try it online!

We construct a list of lists, each of which contains () (nil) some number of times. #* maps the length operator, resulting in a list of numbers. C takes each number as an ASCII code and converts it to a character. The resulting list of characters is then automatically concatenated together and printed.

Happy belated birthday, Brain-Flak!

DLosc

Posted 2017-04-30T13:18:37.153

Reputation: 21 213

1

PHP, 42 Bytes

<?="Surprise!
Happy Birthday, Brain-Flak!"?>

Try it online!

-5 Bytes the boring solution

Surprise!
Happy Birthday, Brain-Flak!

PHP, 60 Bytes

<?=join(array_map(function($v){return chr(strlen($v)/2);},explode("[]","<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>[]<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>")))?>

Try it online!

Jörg Hülsermann

Posted 2017-04-30T13:18:37.153

Reputation: 13 026

You can save 5 by removing <?=""?> – Robert Fraser – 2017-04-30T14:59:56.147

@RobertFraser I know. It is only a text file in this moment. – Jörg Hülsermann – 2017-04-30T15:08:45.227

@JörgHülsermann No, PHP is a programming language according to our definition, using it in a way that resembles a text file is totally valid. – Erik the Outgolfer – 2017-04-30T15:34:03.970

@EriktheOutgolfer Okay I have add it but it is boring and not the solution I prefer – Jörg Hülsermann – 2017-04-30T15:41:05.100

@JörgHülsermann Your ultimate target is to golf, not to make interesting solutions. Maybe you can make a version based on the length of a string with matched brackets so that you can golf it even more. – Erik the Outgolfer – 2017-04-30T15:47:41.000

@EriktheOutgolfer Yes I can make it but really not under the byte count of the simple version. I have add an example – Jörg Hülsermann – 2017-04-30T16:15:02.900

1

Mathematica, 40 bytes

"Surprise!
Happy Birthday, Brain-Flak!"&

Anonymous function. Takes no input and returns a string as output.

LegionMammal978

Posted 2017-04-30T13:18:37.153

Reputation: 15 731

1

Jelly, 19 21 bytes

“µḍ'Ṭẋs:|`¿wwƈг×U7¿»

Nothing at all clever here, just a dictionary + string compression of the text plus a trailing newline to remove an unmatched <.

For a truly golfy approach see this answer by Erik the Outgolfer.

Try it online!

Jonathan Allan

Posted 2017-04-30T13:18:37.153

Reputation: 67 804

1

Stacked, score 23

'....' '(<>)+'match[#'2/]map#:out

Where ... is the omitted string. (This can be generated with this.)

Try it online!

Yeah not that creative. Gets the number of all <>s and converts them to character codes.

Conor O'Brien

Posted 2017-04-30T13:18:37.153

Reputation: 36 228

1

Perl 5, 3304 bytes, 16 score

say(map{chr(y{()}{})}q[()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()({}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()({}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()({}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()({}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()({}()()()()()()()()()()()()()()()()({}()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()({}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()({}()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()){}()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()){}()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()){}()()()()()()()()()()()()()()()()({})()()()()]=~m{[()]+}g)

Try it online!

Uses @HeebyJeebyMan's Python solution's run length encoding of the text.

Xcali

Posted 2017-04-30T13:18:37.153

Reputation: 7 671

0

C, 52 bytes, score 46

f(){puts("Surprise!\nHappy Birthday, Brain-Flak!");}

Naive version. Here is the optimized version.

2501

Posted 2017-04-30T13:18:37.153

Reputation: 748

0

Java, 140 bytes

Try Online

class H{public static void main(String[]args){
String t="()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()[]";
for(int i=0,s=0;i<t.length()/*>*/;i+=2){if(t.charAt(i)=='('/*)*/)s++;else{System.out.printf("%c",s);s=0;}}}}

Khaled.K

Posted 2017-04-30T13:18:37.153

Reputation: 1 435

0

Charcoal, 37 bytes

Surprise!¶Happy Birthday, Brain-Flak!

Try it online!

Just prints the string.

ASCII-only

Posted 2017-04-30T13:18:37.153

Reputation: 4 687