g | x | w | all
Bytes Lang Time Link
056Raku Perl 6 rakudo170501T225641Zbb94
039Vyxal 3240215T165618Zpacman25
065K ngn/k221013T143129Zoeuf
nan221013T133156Zbigyihsu
073Vyxal221013T125739ZDialFros
nan200509T204239Zm4n0
089Batch170428T131453ZSomethin
091Wren200106T131808Zuser8505
058SmileBASIC180303T162908Z12Me21
022Husk170927T024211ZLeo
046///170926T232411ZLeo
041J170926T035629ZFrownyFr
052Jq 1.5170926T020521Zjq170727
087Tcl170926T001601Zsergiol
091Haskell170914T173326Zmaple_sh
053Recursiva170912T122230Z0xffcour
085Javascript170912T134820ZBrian H.
049///170912T134227ZDELETE_M
05405AB1E170428T170950ZMagic Oc
052PowerShell170428T130225Zcolsw
097cat170502T174829Zyo'
082Groovy170505T205527Zstaticme
067Perl170429T024018ZSinan &#
7069ClojureScript170502T220448Zmadstap
083R170428T072600ZMasclins
047APL Dyalog170502T130402ZAdá
076SmileBASIC 3170502T123904Zsnail_
nanC# 103 99 Bytes170502T122353Zraznagul
109C#170428T093002ZMayube
095Haskell 95 Bytes170502T094654ZPharap
158C++ 158 Bytes170502T100813ZPharap
066ksh / bash / sh170430T160915ZULick
068Hack170428T095356ZMayube
096C170502T034559ZImran Kh
071Wolfram Mathematica170501T114418ZSauron
100MySQL170428T204552Zjlmt
074Python 2170428T145614Ztotallyh
nan170428T023258Zhucancod
061PHP170428T071317ZJör
109Emacs Lisp170429T120234ZLord Yuu
072Perl170427T214427Zsteve
075Batch170428T230606ZNeil
277Brainfuck Substitutor170428T163157ZOkx
074Perl170428T071038Zephemien
090Bash170428T155807ZKatharin
061Ruby170427T205017ZValue In
094Fourier170428T165611ZBeta Dec
105Matlab170428T112214Zuser1326
022Jelly170427T200111ZDennis
092AHK170427T210758ZEngineer
103Java 7170428T073759ZKevin Cr
041Pyth170427T205601ZMaria
085C170427T231917Z2501
039Retina170427T220251ZLeo
059Octave170427T195852ZStewie G
060Retina170427T213729ZDigital
072Sed170427T212852ZDigital
03805AB1E170427T205700ZEmigna
060Python 2170427T201336Zxnor
036V170427T201848ZDJMcMayh
070JavaScript170427T200138Zpowelles

Raku (Perl 6) (rakudo), 61 60 56 bytes

$!="Hare ";"$!$_ $!$_
$_ $_ $!$!".say for <Krishna Rama>

Attempt This Online!

Vyxal 3, 39 bytes

"ᶜ₂ᶠ„•;DJ$Ṙd½Jf:•"ᵇcð₇₁„r$•"ᴳ=Ṡ„rJᵛV4Ẇ'

Try it Online!

K (ngn/k), 65 bytes

{`0:,/("Hare ";"Krishna ";"Rama ";"\n")@"ababdbbaadacacdccaa"-97}

Try it online!

This has to be the longest K program I have ever written. Takes "aba..."-97 from the Octave answer.

Go, 167 bytes

func f(){w,i,k:=[]string{"Hare","Krishna","Rama"},[]int{0,1,0,1,1,1,0,0,2,0,2,0,2,2,0,0},0
for _,e:=range i{if k>3{print(`
`)
k=0}
if k>0{print(" ")}
print(w[e])
k++}}

Attempt This Online!

Prints to STDERR.

Vyxal, 73 bytes

`Hλ½ K≥τ⇧¨ Hλ½ K≥τ⇧¨
K≥τ⇧¨ K≥τ⇧¨ Hλ½ Hλ½
Hλ½ R□• Hλ½ R□•
R□• R□• Hλ½ Hλ½`

Try it Online!

CSS 3 logo

CSS: 132 Bytes

No use of HTML. Not the best, not the worst but the Brainfuck (No. of bytes) and Matlab solutions (Direct output) made me post this. Can some CSS wizards help save some bytes?

body:after{content:"Hare Krishna Hare Krishna\AKrishna Krishna Hare Hare\AHare Rama Hare Rama\ARama Rama Hare Hare";white-space:pre}


SASS logo

CSS with superpowers could not beat it until someone can prove me wrong.

SASS: 163 Bytes

$a:Hare;$b:Krishna;$c:Rama;body:after{content:"#{$a} #{$b} #{$a} #{$b}\A#{$b} #{$b} #{$a} #{$a}\A#{$a} #{$c} #{$a} #{$c}\A#{$c} #{$c} #{$a} #{$a}";white-space:pre}

Run it on:

Code Sandbox demo

Batch, 117 111 103 89 bytes

@set a=Hare 
@for %%A in ("Krishna " "Rama ") do @echo %a%%%~A%a%%%~A^

%%~A%%~A%a%%a%

Down to 103 now that trailing newlines are allowed. Down to 89 after adapting the Powershell answer.

^\n\n is used to insert a newline at the end of the first line and there's a space after Hare.

Wren, 91 bytes

Fn.new{
var n="Hare"
return["Krishna","Rama"].map{|i|[n,i,n,i,"
"+i,i,n,n].join(" ")+"
"}
}

Try it online!

Explanation

Fn.new{                                    // New anonymous function
var n="Hare"                               // Define a template constant
return["Krishna","Rama"].map{|i|[n,i,n,i,  /* Map using the rule*/"
"+i,i,n,n].join(" ")+                      /* [n,i,n,i,"\n",i,i,n,n]*/"
"}
}

SmileBASIC, 58 bytes

We can use the fact that the second half is the same as the first, with "Krishna" replaced by "Rama"

P"Krishna 
P"Rama 
DEF P K?("Hare "+K)*2?K*2;"Hare "*2
END

(Note trailing spaces)

Storing "Hare " in a variable is the same length.

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

///, 46 bytes

/4/Hare //k/Krishna //X/4k4k
kk44/X
/k/Rama /X

Try it online!

There was already one answer in ///, but this one adds a bit of complexity to remove some bytes.

In pseudocode this could translate to:

4="Hare "
k="Krishna "
X=4+k+4+k+'\n'+k+k+4+4
print(X+'\n')
replace k with "Rama "
print(X)

(I wanted to use h as the letter to substitute with "Hare ", but "Krishna" also contains an h, so that messed up the substitutions and I had to switch it with 4)

J, 49 41 bytes

;"1{&(<;.2'Hare Krishna Rama ')(,-)#:5 12

How it works

                                   #:5 12 to binary [(0 1 0 1), (1 1 0 0)] 
                               ( -)       negate    [(0-1 0-1),(-1-1 0 0)]
                               (, )       append    [(0 1 0 1),(1 1 0 0),(0-1 0-1),(-1-1 0 0)] 
     (<;. 'Hare Krishna Rama ')           split by 
         2                                the last character, keep it in
   {&                                     negative argument selects from the end
;"1                                       get rid of the ASCII boxes

Try it online!

Jq 1.5, 59 57 54 52 bytes

def h:"Hare "+.;"Krishna ","Rama "|h*2,.*2+"Hare "*2

Try it online!

Tcl, 87 bytes

puts "[set h Hare] [set k Krishna] $h $k
$k $k $h $h
$h [set r Rama] $h $r
$r $r $h $h"

Try it online!

Haskell, 92 91 bytes

g=mapM_ putStr$(!!)["Hare ","Krishna ","Rama ","\n"]<$>(read.(:[]))<$>"0101311003020232200"

Edit: removed concat, used mapM_ for putStr instead

Try it online!

Recursiva, 57 53 bytes

r2r1r0"0101/n1100/n0202/n2200"'Hare ''Krishna ''Rama 

Try it online!

Javascript 85 bytes

I know there's a better answer already, but i wanted to give it a try anyway, the method is pretty different as you'll see:

a=["Krishna ","Rama "];q="Hare ";b=(z)=>q+a[z]+q+a[z]+`
`+a[z]+a[z]+q+q+`
`;b(0)+b(1)

a=["Krishna ","Rama "];q="Hare ";b=(z)=>q+a[z]+q+a[z]+`
`+a[z]+a[z]+q+q+`
`;console.log(b(0)+b(1));

Please note that i had to put the console.log() in a weird spot, if you just paste the code block into the console it'll print the mantra.

dumbded down better golfed version 76 bytes:

a="Krishna ";b="Rama ";c="Hare ";d=`
`;c+a+c+a+d+a+a+c+c+d+c+b+c+b+d+b+b+c+c

a="Krishna ";b="Rama ";c="Hare ";d=`
`;console.log(c+a+c+a+d+a+a+c+c+d+c+b+c+b+d+b+b+c+c)

///, 49 bytes

/#/Hare //k/Krishna //j/Rama /#k#k
kk##
#j#j
jj##

Try it online!

Although /// is an esoteric language, this one is shorter than most of the other (non-golfing, and a bad implementation of this problem in Retina) languages here. Mostly because /// has too few functionalities, that they can be represented in few bytes.

05AB1E, 54 bytes

•4Ñ••}ò´••9Ä•)©\•2}¾S•3BRv®yè8ÝJ"ahrekisnm"‡})4ôvyðý™,

Try it online!

•4Ñ•                          # Hare
    •}ò´•                     # Krishnu
         •9Ä•)©\              # Rama
                •2}¾S•3BR     # Sequencing data.
v®yè8ÝJ"ahrekisnm"‡}          # For each sequence part, push the right word.
                    )4ôvyðý™, # Format it correctly.

05AB1E changed its base-214 encryption to base-255; this is the reason this submission no longer works; however, it was valid at the time.

PowerShell, 73 53 52 Bytes

absolutely demolished by 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.

cat 97 bytes

Hare Krishna Hare Krishna<CR>
Krishna Krishna Hare Hare<CR>
Hare Rama Hare Rama<CR>
Rama Rama Hare Hare<^D>

I consider <^D> as two characters, whence 97

Groovy, 82 bytes

a=["Hare ","Krishna ","Rama ","\n"]
"0101311003020232200".each{print a[it as int]}

An improvement of my previous answer (1 byte longer)

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

Perl, 67 bytes

Inspired by this JavaScript entry.

$_='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>

Clojure(Script), 70 bytes (69 bytes?)

(def a"Hare")(run! #(println a % a %(str"\n"%)% a a)["Krishna""Rama"])

This version with 69 bytes will only work at the repl, because map is lazy and I don't use the return value for anything. Dunno how the rules work in this case...

(def a"Hare")(map #(println a % a %(str"\n"%)% a a)["Krishna""Rama"])

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.

APL (Dyalog), 47 bytes

Requires ⎕IO←0 which is default on many systems.

↑∊¨↓'Krishna ' 'Hare ' 'Rama '[(4⍴3)⊤8×4 1 5 2]

Try it online!

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)

SmileBASIC 3, 76 bytes

Straightforward answer with string multiplication. ? is print.

?"Hare Krishna "*2?"Krishna "*2+"Hare "*2?"Hare Rama "*2?"Rama "*2+"Hare "*2

C# 103 99 Bytes

()=>{string a="Hare ",b="Krishna ",c="Rama ",d="\n";return a+b+a+b+d+b+b+a+a+d+a+c+a+c+d+c+c+a+a;};

Ungolfed full program:

class A
{
    static void Main()
    {
        System.Func<string> f =
            () =>
            {
                string a = "Hare ",
                    b = "Krishna ",
                    c = "Rama ",
                    d = "\n";
                return a + b + a + b + d + b + b + a + a + d + a + c + a + c + d + c + c + a + a;
            };
        System.Console.Write(f());
    }
}

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.

Haskell 103 95 Bytes

main=putStr$concat$concat$[[h,x,h,x,n,x,x,h,h,n]|x<-["Krishna ","Rama "]]where h="Hare ";n="\n"

Old 103 Bytes:

main=putStr$concat[h,k,h,k,n,k,k,h,h,n,h,r,h,r,n,r,r,h,h] where h="Hare ";k="Krishna ";r="Rama ";n="\n"

C++ 158 Bytes

#include <iostream>
#define H "Hare "
#define K "Krishna "
#define R "Rama "
#define N "\n"
void m(){std::cout<<(H K H K N K K H H N H R H R N R R H H);}

ksh / bash / sh, 66 bytes

h=Hare;for j in Krishna Rama;do echo $h $j $h $j"
"$j $j $h $h;done

Hack 68 bytes

<?hh echo strtr("0101
1100
0202
2200",["Hare ","Krishna ","Rama "]);

Straight port of the PHP Answer, just wanted to finally get an excuse to use hack in PPCG :D

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).

Wolfram Mathematica, 71 75 bytes

{"Krishna ","Hare ","Rama ","\n"}[[IntegerDigits[73825885093,4]+1]]<>""

Every part of result was encoded as an index in a list, and every index was encoded as digit of 4-ary integer.

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

Python 2, 92 88 74 bytes

for i in'0101311003020232200':print['Hare','Krishna','Rama','\n'][int(i)],

Try it online!

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

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!

28 bytes saved, thanks to Dennis

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

Try it online!

Emacs Lisp, 109 bytes

(lambda()(apply'concat(mapcar(lambda(x)(nth(- x ?a)'("Hare ""Krishna ""Rama ""\n")))"ababdbbaadacacdccaad")))

Can theoretically be reduced to 103 bytes by using ^@,^A,^B and ^C instead of a, b, c and d and x instead of (nth(- x ?a)), but then it could not be pasted due to NULL characters.

Perl, 98 72 bytes

@a=("Hare ","Krishna ","Rama ","\n");foreach(split//,'ababdbbaadacacdccaad'){print $a[ord($_)-97]}

98 now reduced to 72, following @hobbs reworking, nice.

print+("Hare ","Krishna ","Rama ",$/)[$_]for'01013110030202322003'=~/./g

Batch, 75 bytes

@for %%h in (Krishna Rama)do @echo Hare %%h Hare %%h&echo %%h %%h Hare Hare

Brainfuck Substitutor, 277 bytes

{--y{-z[<]w++v->u>+<t-[x[-]Hxtuyy-]>-.ax+[ty<]>>-]<-.rx>+[-vwz>-]>.ext>w<y{]>-. x>tt-<]>u]>-.Kxtuyy-]>w.ix+[v-z>{]>.sx+[vv-z>{]>.hx+[v-z>{]>-.nxt>{<yy-]>.!xwwwww.Rxtuy]>y.mx+[v-z>+>{]>.
Hare Krishna Hare Krishna!Krishna Krishna Hare Hare!Hare Rama Hare Rama!Rama Rama Hare Hare

Brainfuck Substitutor (or BFS for short) can redefine characters to be replaced with other characters.

This program redefines the characters of the Hare Krishna mantra with brainfuck 'mini' programs that prints the appropiate characters.

As this is run in succinct mode (which doesn't need any command line arguments and is on my default), we can't redefine newlines (at least, in the current version) so I use the character ! instead - but it still outputs a newline.

This first bit of the program: {--y{-z[<]w++v->u>+<t-[x[-] is short replacements for patterns that come up often in the future.

The interpreter breaks them down like this:

{ equals --
y equals {- equals ---
z equals [<]
w equals ++
v equals ->
u equals >+<
t equals -[
x equals [-]

Similar thing goes for every other character. I used the shortest brainfuck constants on the esolangs wiki page to get my algorithms, and replaced common patterns. There may be other patterns I can replace (my original attempt was 320 bytes), but this is what I have for now.

Perl, 76 74 bytes

$_=121202211;$_.=0 .y/2/3/r;print$_?(0,Hare,Krishna,Rama)[$_].$":$/for/./g

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}"

Ruby, 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!

Fourier, 94 bytes

|72a97a114a101a32a|H|75a114a-9a115a104a+6a97a32a|K|82a97a109a97a32a|RHKHK10aKKHH10aHRHR10aRRHH

Try it on FourIDE!

Makes good use of functions: H for Hare, K for Krishna and R for Rama.

Now I can't get the song My Sweet Lord out of my head :P

Matlab 139 136 105 bytes (thanks to @2501)

fprintf('Hare Krishna Hare Krishna\nKrishna Krishna Hare Hare\nHare Rama Hare Rama\nRama Rama Hare Hare')

Try it Online in Octave!

Jelly, 22 bytes

“t,ȧṫÞċḅ»Ḳ“¡¥Ɓc’ṃs4K€Y

Try it online!

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.

AHK, 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, 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 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.

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.

Pyth -- 45 41 bytes

Ms(GHGHbHHGG)K"Hare "gK"Krishna "gK"Rama 

Try It

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.

This compacts a naive implementation by 23 bytes.

Retina, 39 bytes


hkhk¶kkhh
h
Hare 
*`k
Krishna 
k
Rama 

Try it online!

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.

Octave, 74 59 bytes

[{'Hare ','Krishna ','Rama ',10}{'ababdbbaadacacdccaa'-96}]

Verify the output here.

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 = ...

Retina, 60

Direct port of my sed answer:


Hari Krishna
.+
$0 $0
:`(\S+)(.*)\b(.+)
$0¶$3$2$1
K\S+
Rama

Try it online.

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.

05AB1E, 38 bytes

Can be shortened by 2 bytes if trailing newlines are okay.

“«Î‡Ä¦í¥Â“#€¦`«'kì)™ð«•2ÍZì•3BSè#4ô¨»?

Try it online!

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

Python 2, 60 bytes

a="Hare"
for x in"Krishna","Rama":print a,x,a,x+'\n',x,x,a,a

Try it online!

This seems to beat template-replacement approaches like this attempt.

V, 40, 36 bytes

iHare Krishna 
 Rama ç^/ä$Ùdww.$2p

Try it online!

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. :)

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]))