Skip to main content
Commonmark migration
Source Link

#R, 75 85 83 bytes

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.

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

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.

deleted 73 characters in body
Source Link
Masclins
  • 943
  • 4
  • 20

#R, 75 85 bytes

Edited so style is exactly as expected. I had to use <- rather than = because cat would read them as arguments otherwise.85 83 bytes

cat(h<x<-c("Hare ",k<-"Krishna ",h"\n")[c(1,k2,n<-"\n"1:3,k2,k2,h1,h1,n3)],hsub(x[2],r<-"Rama ",h,r,n,r,r,h,hx),sep="")

Old:It creates a vector with Hare , Krishna , and the newline, takes the ones needed, and then repeats it replacing Krishna by Rama .

p=paste;p(h="Hare",k="Krishna",h,k);p(k,k,h,h);p(h,r="Rama",h,r);p(r,r,h,h)

Needed to include the space on every word and sep="" because otherwise cat() would put a space at the beginning of each line.

#R, 75 85 bytes

Edited so style is exactly as expected. I had to use <- rather than = because cat would read them as arguments otherwise.

cat(h<-"Hare ",k<-"Krishna ",h,k,n<-"\n",k,k,h,h,n,h,r<-"Rama ",h,r,n,r,r,h,h,sep="")

Old:

p=paste;p(h="Hare",k="Krishna",h,k);p(k,k,h,h);p(h,r="Rama",h,r);p(r,r,h,h)

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

added 334 characters in body
Source Link
Masclins
  • 943
  • 4
  • 20

###R#R, 7575 85 bytes

Edited so style is exactly as expected. I had to use <- rather than = because cat would read them as arguments otherwise.

cat(h<-"Hare ",k<-"Krishna ",h,k,n<-"\n",k,k,h,h,n,h,r<-"Rama ",h,r,n,r,r,h,h,sep="")

Old:

p=paste;p(h="Hare",k="Krishna",h,k);p(k,k,h,h);p(h,r="Rama",h,r);p(r,r,h,h)

###R, 75 bytes

p=paste;p(h="Hare",k="Krishna",h,k);p(k,k,h,h);p(h,r="Rama",h,r);p(r,r,h,h)

#R, 75 85 bytes

Edited so style is exactly as expected. I had to use <- rather than = because cat would read them as arguments otherwise.

cat(h<-"Hare ",k<-"Krishna ",h,k,n<-"\n",k,k,h,h,n,h,r<-"Rama ",h,r,n,r,r,h,h,sep="")

Old:

p=paste;p(h="Hare",k="Krishna",h,k);p(k,k,h,h);p(h,r="Rama",h,r);p(r,r,h,h)
Source Link
Masclins
  • 943
  • 4
  • 20
Loading