Husk, 22 bytes
ṁSeÖ>m´+Πmw¶¨Hȧeȷ#,R□m
Try it online!
I've worked for quite some time on this answer since I wanted to beat the "compressed number" algorithm of the current top answer by exploiting more of the regularities in the text.
In the end I "only" managed to tie its score. I actually have in mind a couple of builtins for Husk that could easily save more bytes, but implementing them before posting this answer would have felt too much like cheating.
Explanation
Husk automatically prints a matrix of strings by joining them with spaces and newlines. In this case we are actually trying to build the matrix
[["Hare","Krishna","Hare","Krishna"],
["Krishna","Krishna","Hare","Hare"],
["Hare","Rama","Hare","Rama"],
["Rama","Rama","Hare","Hare"]]
which will implicitly get printed to StdOut as the required text. For simplicity, I will show each step of computation as if it was printed by a full program, joining strings with spaces and newlines.
We need to work with "Hare" and ("Krishna" and "Rama"): mw¶¨Hȧeȷ#,R□m
¨Hȧeȷ#,R□m
is a compressed string; Husk has a dictionary containing common n-grams (sequences of characters) which are encoded with symbols possibly reminding of the original n-gram. For example, the H
here is a plain "H", while ȧe
is "are\n".
The plaintext string this decodes to is "Hare\nKrishna Rama" (where \n
is an actual newline).
¶
splits this string on the newline, and mw
splits each line into words. The output we get up to here is:
Hare
Krishna Rama
"Hare" should pair with both of the other words: Π
Cartesian product of all the lines. This means that we pair each element of the first line with each element of the second line. Our result is:
Hare Krishna
Hare Rama
The first and third lines are just those words repeated twice: m´+
Concatenate each of the lines with itself. (´
makes +
use a single argument twice, and m
maps this function to each line). We get:
Hare Krishna Hare Krishna
Hare Rama Hare Rama
The other lines are the previous lines sorted in reverse alphabetical order: ṁSeÖ>
This is not as weird as it looks. Ö>
sorts a list in descending order. With SeÖ>
we create a two-element list with the original argument before and after having been sorted. ṁ
maps this function to each line, and concatenates the resulting lists. This is finally:
Hare Krishna Hare Krishna
Krishna Krishna Hare Hare
Hare Rama Hare Rama
Rama Rama Hare Hare
2From the title I was expecting something to decode binary strings into ASCII characters. The title represents a backslash. – user253751 – 2017-05-01T23:12:02.403
6All the mantra has 97 bytes. Surpisingly enough, there are answers with more than that many bytes. – Masclins – 2017-05-02T08:03:40.700
Hmm, Why does it surprisingly look like a Rickroll dupe? – Matthew Roh – 2017-05-02T13:07:57.993