[Question]
  [
Recently, I've seen Hare Krishna people with their mantra on the emblem and I've found it may be quite interesting to code golf.
# The challenge
Write the [Hare Krishna mantra](https://en.wikipedia.org/wiki/Hare_Krishna_(mantra)), i.e.:
```
Hare Krishna Hare Krishna
Krishna Krishna Hare Hare
Hare Rama Hare Rama
Rama Rama Hare Hare
```
# Winning criteria
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest code in bytes wins!
# Rules
* Casing must be preserved.
* Text should contain new lines.
* Lines may have trailing space(s).
* Trailing newline is allowed.
* Parsing from web or any other external resource disallowed.
  
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 22 bytes
```
“t,ȧṫÞċḅ»Ḳ“¡¥Ɓc’ṃs4K€Y
```
[Try it online!](https://tio.run/nexus/jelly#ATAAz///4oCcdCzIp@G5q8OexIvhuIXCu@G4suKAnMKhwqXGgWPigJnhuYNzNEvigqxZ//8 "Jelly – TIO Nexus")
### How it works
```
“t,ȧṫÞċḅ»Ḳ“¡¥Ɓc’ṃs4K€Y  Main link. No arguments.
“t,ȧṫÞċḅ»               Use Jelly's dictionary to yield the string
                        "Hare Rama Krishna". Fortunately, the words Rama, Krishna,
                        and hare (lowercase H) are in the dictionary.
         Ḳ              Split at spaces, yielding ["Hare", "Rama", "Krishna"].
          “¡¥Ɓc’        Base-250 literal; yielding 15973600.
                ṃ       Convert 15973600 to base ["Hare", "Rama", "Krishna"]
                        (ternary), where "Krishna" = 0, "Hare" = 1, and "Rama" = 2.
                 s4     Split the resulting string array into chunks of length 4.
                   K€   Join each of the four chunks by spaces.
                     Y  Join the resulting strings by linefeeds.
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 38 bytes
Can be shortened by 2 bytes if trailing newlines are okay.
```
“«Î‡Ä¦í¥Â“#€¦`«'kì)™ð«•2ÍZì•3BSè#4ô¨»?
```
[Try it online!](https://tio.run/nexus/05ab1e#AUkAtv//4oCcwqvDjuKAocOEwqbDrcKlw4LigJwj4oKswqZgwqsna8OsKeKEosOwwqvigKIyw41aw6zigKIzQlPDqCM0w7TCqMK7P/// "05AB1E – TIO Nexus")
**Explanation**
```
“«Î‡Ä¦í¥Â“                              # push the string "drama share irish dna"
          #                             # split on spaces
           €¦                           # remove the first character of each word
             `                          # split to stack as separate words 
              «'kì                      # concatenate the last 2 and prepend "k"
                  )™                    # wrap in list and title-case
                    ð«                  # append a space to each
                      •2ÍZì•            # push 27073120
                            3B          # convert to base-3: 1212221110100011
                              Sè        # index into the list with each
                                #       # split on spaces
                                 4ô     # split into pieces of 4
                                   ¨    # remove the last
                                    »   # join on spaces and newlines
                                     ?  # print without newline
```
[Answer]
# [Python 2](https://docs.python.org/2/), 60 bytes
```
a="Hare"
for x in"Krishna","Rama":print a,x,a,x+'\n',x,x,a,a
```
[Try it online!](https://tio.run/nexus/python2#@59oq@SRWJSqxJWWX6RQoZCZp@RdlFmckZeopKMUlJibqGRVUJSZV6KQqFOhA8Ta6jF56kAmiJP4/z8A "Python 2 – TIO Nexus")
This seems to beat template-replacement approaches [like this attempt](https://tio.run/nexus/python3#@19QlJlXoqHEyMTIFJPHxMTIGJPHyMzIHJPHzMzIqKRXUpSYV5yTWJKqEW2go@SRWJSqoKSj5F2UWZyRlwhiBiXmAulYTc3//wE).
[Answer]
# Octave, ~~74~~ 59 bytes
```
[{'Hare ','Krishna ','Rama ',10}{'ababdbbaadacacdccaa'-96}]
```
[Verify the output here](https://tio.run/#pH5l6).
**Explanation:**
`{'Hare ','Krishna ','Rama ',10}` creates a cell array with three strings, where the fourth is `10` (ASCII-value for newline).
`{'ababdbbaadacacdccaa'-96}` is a vector that indexes the cell array above. The vector is `[1 2 1 2 4 ...]` since we subtract `96` from the string `ababd...`.
The surrounding square brackets are used to concatenate the results, instead of getting `ans = Hare; and = Krishna; ans = ...`
[Answer]
# [Retina](https://github.com/m-ender/retina), 39 bytes
```
hkhk¶kkhh
h
Hare 
*`k
Krishna 
k
Rama 
```
[Try it online!](https://tio.run/nexus/retina#@8@VkZ2RfWhbdnZGBlcGl0diUaoCl1ZCNpd3UWZxRl6iAlc2V1BibqLC//8A "Retina – TIO Nexus")
Mostly plain substitutions, the only "trick" is the modifier `*` which prints the result of the substitution and then reverts the string back to what it was before.
[Answer]
# PHP, 61 Bytes
```
<?=strtr("0101
1100
0202
2200",["Hare ","Krishna ","Rama "]);
```
simply replacement from the digits as key in the array with the values [strtr](http://php.net/manual/en/function.strtr.php)
[Try it online!](https://tio.run/nexus/php#@29jb1tcUlRSpKFkYGhgyGVoaGDAZWBkYMRlZGRgoKQTreSRWJSqoKSj5F2UWZyRlwhiBiXmAulYTev//wE "PHP – TIO Nexus")
[Answer]
# JavaScript, ~~75~~ 70 bytes
```
`0101
1100
0202
2200`.replace(/./g,n=>['Hare ','Krishna ','Rama '][n])
```
### Try it online!
```
console.log(`0101
1100
0202
2200`.replace(/./g,n=>['Hare ','Krishna ','Rama '][n]))
```
[Answer]
# C
# ~~154 bytes, 124 bytes,~~ 96 bytes
```
i;main(){char*c="agagvggaavapapvppaaHare \0Krishna \0Rama \0\n";while(i<19)printf(c+c[i++]-78);}
```
[Try it online!](https://tio.run/nexus/c-gcc#@59pnZuYmaehWZ2ckViklWyrlJiemF6Wnp6YWJZYkFhQVlCQmOiRWJSqEGPgXZRZnJGXCGQFJeaCqJg8JevyjMycVI1MG0NLzYKizLySNI1k7eToTG3tWF1zC03r2v//AQ "C (gcc) – TIO Nexus")
28 bytes saved, thanks to [Dennis](https://codegolf.stackexchange.com/users/12012/dennis)
[Answer]
# [V](https://github.com/DJMcMayhem/V), ~~40~~, 36 bytes
```
iHare Krishna 
 Rama ç^/ä$Ùdww.$2p
```
[Try it online!](https://tio.run/nexus/v#@5/pkViUquBdlFmckZeowMWnEJSYm6ggfXh5nP7hJSqHZ6aUl@upGBX8/w8A "V – TIO Nexus")
Hexdump:
```
00000000: 6948 6172 6520 4b72 6973 686e 6120 0a0e  iHare Krishna ..
00000010: 2052 616d 6120 1be7 5e2f e424 d964 7777   Rama ..^/.$.dww
00000020: 2e24 3270                                .$2p
```
Explanation:
```
iHare Krishna   " Enter 'Hare Krishna' on line 1
<C-n> Rama      " Enter 'Hare Rama' on line 2. This works because <C-n>
                " autocompletes alphabetically, and 'Hare' comes before 'Krishna'
<esc>           " Return to normal mode
ç^/             " On every line:
   ä$           "   Duplicate the text on the line horizontally
     Ù          "   Make a new copy of the line
      dw        "   Delete a word
        w       "   Move forward a word
         .      "   Delete a word again
          $     "   Move to the end of the line
           2p   "   And paste what we've deleted twice
```
The `<C-n>` command is extremely useful for challenges like this. :)
[Answer]
# C#, 109 bytes
```
void a(){Console.Write("{0}{1}{0}{1}\n{1}{1}{0}{0}\n{0}{2}{0}{2}\n{2}{2}{0}{0}","Hare ","Krishna ","Rama ");}
```
Fairly straightforward, `Console.Write` implicitly formats the string, and using `Write` instead of `WriteLine` not only saves 4 bytes, but avoids a trailing newline. Uses Unix-style newlines so might not work so well on windows, extra 6 bytes for windows by changing `\n` to `\r\n`
This method will output directly to the console, if you prefer a method that returns a string:
### C#, 118 bytes
```
string a(){return string.Format("{0}{1}{0}{1}\n{1}{1}{0}{0}\n{0}{2}{0}{2}\n{2}{2}{0}{0}","Hare ","Krishna ","Rama ");}
```
Alternatively if you need a fully stand-alone and compilable program:
### C#, 135 bytes
```
class A{static void main(){System.Console.Write("{0}{1}{0}{1}\n{1}{1}{0}{0}\n{0}{2}{0}{2}\n{2}{2}{0}{0}","Hare ","Krishna ","Rama ");}}
```
This should work as a compiled program provided you set `A` as the entry class.
[Answer]
# Python 2, ~~92~~ ~~88~~ 74 bytes
```
for i in'0101311003020232200':print['Hare','Krishna','Rama','\n'][int(i)],
```
[Try it online!](https://tio.run/nexus/python2#@5@WX6SQqZCZp25gaGBobGhoYGBsYGRgZGxkZGCgblVQlJlXEq3ukViUqq6j7l2UWZyRlwhkBSXmgqiYPPXYaKAKjUzNWJ3//wE "Python 2 – TIO Nexus")
*No*, it's not clever, no, it's not the shortest but hey, I'm new to this and it works.
Another solution (~~84~~ 80 bytes):
```
h='Hare'
k='Krishna'
r='Rama'
n='\n'
print h,k,h,k,n+k,k,h,h,n+h,r,h,r,n+r,r,h,h
```
[Answer]
## C, 85 bytes
```
i;f(){for(i=0;printf("$0$0900$$9$*$*9**$$)"[i++]-36+"Hare \0Rama \0Krishna \0\n"););}
```
I would prefer a secular mantra, but I hope this is one of those peaceful religions.
See it [work here](https://tio.run/nexus/c-gcc#@59pnaahWZ2WX6SRaWtgXVCUmVeSpqGkYqBiYGlgoKJiqaKlomWppaWioqkUnamtHatrbKat5JFYlKoQYxCUmJsIpLyLMosz8kCsmDwlTWtN69r/QFMUchMz8zQUyvIzUxQ0uaq5OIH2WHPV/gcA).
This compacts a naive implementation by 23 bytes.
[Answer]
## Perl, 67 bytes
Inspired by this [JavaScript entry](/a/117846/8861).
```
$_='0101
1100
0202
2200
';s/./qw'Hare Krishna Rama'[$&].$"/ge;print
```
## Perl, 67 bytes
```
@_=<Hare Krishna Rama>;print"@_[split//]\n"for<0101 1100 0202 2200>
```
[Answer]
# Matlab ~~139 136~~  105 bytes (thanks to @[2501](https://codegolf.stackexchange.com/users/67705/2501))
```
fprintf('Hare Krishna Hare Krishna\nKrishna Krishna Hare Hare\nHare Rama Hare Rama\nRama Rama Hare Hare')
```
[Try it Online in Octave!](https://tio.run/nexus/octave#@59WUJSZV5Kmoe6RWJSq4F2UWZyRl6iAzInJg4miyIKImDwwMygxFyoIYsXkgfkIQRChrvn/PwA)
[Answer]
# MySQL, ~~115~~ 100 bytes
(Thanks @manatwork!)
```
SELECT CONCAT(a,b,a,b,d,b,b,a,a,d,a,c,a,c,d,c,c,a,a)FROM(SELECT'Hare 'a,'Krishna 'b,'Rama 'c,'\n'd)t
```
[Answer]
# R, ~~75~~ ~~85~~ 83 bytes
```
cat(x<-c("Hare ","Krishna ","\n")[c(1,2,1:3,2,2,1,1,3)],sub(x[2],"Rama ",x),sep="")
```
It creates a vector with `Hare` , `Krishna` , and the newline, takes the ones needed, and then repeats it replacing `Krishna`  by `Rama` .
Needed to include the space on every word and `sep=""` because otherwise `cat()` would put a space at the beginning of each line.
[Answer]
# PowerShell, ~~73~~ ~~53~~ 52 Bytes
absolutely demolished by [Jeff Freeman](https://codegolf.stackexchange.com/users/68634/jeff-freeman) - using an actual newline instead of `\n` saves another byte, and also saved one more on the array format. (from `(1,2)` to `,1,2`)
-1 thanks to TesselatingHeckler, no comma in the array notation.
```
$a="Hare ";"Krishna ","Rama "|%{"$a$_$a$_
$_$_$a$a"}
```
My old answer - Tried a few other replace methods but all ended up being slightly longer somehow.
```
$a,$b,$c="Hare ","Krishna ","Rama ";"$a$b$a$b
$b$b$a$a
$a$c$a$c
$c$c$a$a"
```
there are newlines in the string.
pretty straightforward, uses the fact that powershell will expand variables within doublequotes, and a shorter method of assigning variables to save some bytes.
[Answer]
# Sed, 72
Score includes +1 for the `-r` flag.
```
s/^/Hari Krishna/
s/.*/& &/
s/(\S+)(.*)\b(.+)/&\n\3\2\1/p
s/K\S+/Rama/g
```
[Try it online](https://tio.run/nexus/sed#@1@sH6fvkViUqeBdlFmckZeoz1Wsr6elr6agBmJpxARra2roaWnGJGnoaWvqq8XkxRjHGMUY6hcAZb2BsvpBibmJ@un////LLyjJzM8r/q9bBAA).
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~62~~ 61 bytes
As I worked on this it eventually became almost identical to @xnor's Python answer, except Ruby doesn't have spaces between arguments in its `print` function, forcing me to use joins instead and resulting in a longer answer...
-1 bytes from @manatwork
```
%w"Krishna Rama".map{|i|puts [h=:Hare,i]*2*' ',[i,i,h,h]*' '}
```
[Try it online!](https://tio.run/nexus/ruby#@69aruRdlFmckZeoEJSYm6ikl5tYUF2TWVNQWlKsEJ1ha@WRWJSqkxmrZaSlrqCuE52pk6mToZMRC@LV/v8PAA "Ruby – TIO Nexus")
[Answer]
# Bash, ~~93~~ 90 bytes
```
h="Hare " k="Krishna " r="Rama " s="$h$k$h$k\n$k$k$h$h\n$h$r$h$r\n$r$r$h$h"
echo -e "${s}"
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), 22 bytes
```
ṁSeÖ>m´+Πmw¶¨Hȧeȷ#,R□m
```
[Try it online!](https://tio.run/##ASkA1v9odXNr///huYFTZcOWPm3CtCvOoG13wrbCqEjIp2XItyMsUuKWoW3//w "Husk – 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
```
[Answer]
# Pyth -- ~~45~~ 41 bytes
```
Ms(GHGHbHHGG)K"Hare "gK"Krishna "gK"Rama 
```
[Try It](http://pyth.herokuapp.com/?code=Ms%28GHGHbHHGG%29K%22Hare+%22gK%22Krishna+%22gK%22Rama+&debug=0)
[Answer]
# [AHK](https://autohotkey.com/), ~~107~~ 92 bytes
This feels ridiculous but I can't find a shorter means in AHK to do this:
```
h=Hare
k=Krishna
Send %h% %k% %h% %k%`n%k% %k% %h% %h%`n%h% Rama %h% Rama`nRama Rama %h% %h%
```
---
Here's what I tried first that was 107 bytes and tried to be fancy. As [Digital Trauma pointed out](https://codegolf.stackexchange.com/a/117842/117857#comment288559_117857), though, it would have been shorter to just send the raw text.
```
n=1212422114131343311
a=Hare |Krishna |Rama |`n
StringSplit,s,a,|
Loop,Parse,n
r:=r s%A_LoopField%
Send %r%
```
[StringSplit](https://autohotkey.com/docs/commands/StringSplit.htm) creates a pseudo-array with 1 as the first index. So the first term is referenced with `s1`, the second with `s2`, etc. Otherwise, there's nothing fancy here.
[Answer]
## Batch, 75 bytes
```
@for %%h in (Krishna Rama)do @echo Hare %%h Hare %%h&echo %%h %%h Hare Hare
```
[Answer]
# C 96 bytes
```
*v[]={"Hare ","Krishna ","Rama ","\n"};
main(){for(long a=0x30ae2305d10;a/=4;printf(v[a&3]));}
```
You only need two bits of information to figure out which word from the prayer is needed next, so instead of using a bunch of memory and encoding it as a string, you can just encode it as a 40 bit integer (i.e. inside a long int). 
[Answer]
# ksh / bash / sh, 66 bytes
```
h=Hare;for j in Krishna Rama;do echo $h $j $h $j"
"$j $j $h $h;done
```
[Answer]
# [APL (Dyalog)](https://www.dyalog.com/), 47 bytes
Requires `⎕IO←0` which is default on many systems.
```
↑∊¨↓'Krishna ' 'Hare ' 'Rama '[(4⍴3)⊤8×4 1 5 2]
```
[Try it online!](https://tio.run/nexus/apl-dyalog#e9Q31dP/UdsEA65HHe1p/x@1TXzU0XVoxaO2yereRZnFGXmJCuoK6h6JRakgOigxF8iP1jB51LvFWPNR1xKLw9NNFAwVTBWMYv8DDfifBgA "APL (Dyalog Unicode) – TIO Nexus")
`8×4 1 5 2` multiply; [32,8,40,16]
`(4⍴3)⊤` convert to 4-digit base 3; matrix [[1,0,1,0],[0,0,1,1],[1,2,1,2],[2,2,1,1]]
…`[`…`]` index
`↓` split into list of lists
`∊¨` enlist (flatten each)
`↑` mix into matrix (padding with spaces)
[Answer]
# [Haskell](https://www.haskell.org/), ~~92~~ 91 bytes
```
g=mapM_ putStr$(!!)["Hare ","Krishna ","Rama ","\n"]<$>(read.(:[]))<$>"0101311003020232200"
```
Edit: removed concat, used mapM\_ for putStr instead
[Try it online!](https://tio.run/##y0gszk7Nyfn/P902N7HAN16hoLQkuKRIRUNRUTNaySOxKFVBSUfJuyizOCMvEcQMSswF0zF5SrE2KnYaRamJKXoaVtGxmppArpKBoYGhsaGhgYGxgZGBkbGRkYGB0v/cxMw8BVuF9P8A "Haskell – Try It Online")
[Answer]
# Retina, 60
Direct port of [my sed answer](https://codegolf.stackexchange.com/a/117860/11259):
```
Hari Krishna
.+
$0 $0
:`(\S+)(.*)\b(.+)
$0¶$3$2$1
K\S+
Rama
```
[Try it online](https://tio.run/nexus/retina#@8/lkViUqeBdlFmckZfIpafNpWKgoGLAZZWgEROsramhp6UZk6Shp60JFD@0TcVYxUjFkMsbKMUVlJib@P8/AA).
[Answer]
# Java 7, ~~104~~ 103 bytes
```
String c(){return"xyxy\nyyxx\nxRama xRama\nRama Rama xx".replace("x","Hare ").replace("y","Krishna ");}
```
**Explanation:**
```
String c(){                                      // Method without parameters and String return-type
  return"xyxy\nyyxx\nxRama xRama\nRama Rama xx"  //  Return this String
    .replace("x","Hare ")                        //  after we've replaced all "x" with "Hare "
    .replace("y","Krishna ");                    //  and all "y" with "Krishna "
}                                                // End of method
```
[Try it here.](https://tio.run/nexus/java-openjdk#RY4xCsMwDEX3nEJ4sqH4ArlAoWRpxqaD6prWkCjBVlqZkLOnJhmq4evzpOG5HlOCZtlajoFe4LRZouc5kpIsuaOcRTqSKw4Ie3a09wOIstFPPTqvlaiTOmP0oMwf5gIvMaQ3YeH1ugFM86MPDhIjl/UZwxMGDKQPg9sd0CwVlGlzYj/YcWY7lRNr8l9otLFF0tTlZa3W7Qc)
]