Skip to main content
added 157 characters in body
Source Link
Giuseppe
  • 29.4k
  • 3
  • 33
  • 106

R, 85 bytes

for(i in seq(l<-strsplit(readLines(),"")))cat("if"(i%%2,`(`,rev)(l[[i]]),"\n",sep="") 

Try it online!

Input from stdin and output to stdout.

Each line must be terminated by a linefeed/carriage return/CRLF, and it prints with a corresponding newline. So, inputs need to have a trailing linefeed.

R, 85 bytes

for(i in seq(l<-strsplit(readLines(),"")))cat("if"(i%%2,`(`,rev)(l[[i]]),"\n",sep="") 

Try it online!

Input from stdin and output to stdout.

R, 85 bytes

for(i in seq(l<-strsplit(readLines(),"")))cat("if"(i%%2,`(`,rev)(l[[i]]),"\n",sep="") 

Try it online!

Input from stdin and output to stdout.

Each line must be terminated by a linefeed/carriage return/CRLF, and it prints with a corresponding newline. So, inputs need to have a trailing linefeed.

Source Link
Giuseppe
  • 29.4k
  • 3
  • 33
  • 106

R, 85 bytes

for(i in seq(l<-strsplit(readLines(),"")))cat("if"(i%%2,`(`,rev)(l[[i]]),"\n",sep="") 

Try it online!

Input from stdin and output to stdout.