Skip to main content
added 170 characters in body
Source Link
Giuseppe
  • 28.8k
  • 3
  • 31
  • 105

R, 88 86 bytes

cat(intToUtf8(rbind(diffinv(matrix(c(66,-32,-31),25,5,T)[,1:3],,,t(c(32,65,97))),10)))

Try it online!

R is terrible at string manipulation and although it has some neat matrix builtins, rotations are another thing it doesn't do very easily. I will happily give a bounty to anyone who can out-golf me in R.

Despite my having found a shorter answer, I'll still award a 50 rep bounty to the first other R answer shorter than 88 bytes.

I suppose I'd award myself the bounty if I could, but this is a whole two bytes shorter than the "boring" answer! I avoid rotations by just using R's penchant for recycling.

EDIT: user2390246's answer completely outgolfed me and I will be awarding a 100 point bounty since that solution is far superior.

To get here, I deconstructed the desired output to their ASCII code points with utf8ToInt (removing the newlines), built a matrix, and ran a diff on themm getting the columnwise differences. Noting the periodicity there, I set out to construct the matrix in a golfy fashion, hoping to use diffinv to recreate the original.

Thanks to the periodicity, we can recreate the diffed matrix by forcing R to recycle with a non-multiple length, and extract the columns we actually wanted:

matrix(c(66,-32,-31),25,5,T)[,1:3]

Then we invert this process, with diffinv to recreate the code points, append a row of 10 (newlines) to the bottom, reconvert to ASCII with intToUtf8, and cat the result.

R, 88 86 bytes

cat(intToUtf8(rbind(diffinv(matrix(c(66,-32,-31),25,5,T)[,1:3],,,t(c(32,65,97))),10)))

Try it online!

R is terrible at string manipulation and although it has some neat matrix builtins, rotations are another thing it doesn't do very easily. I will happily give a bounty to anyone who can out-golf me in R.

Despite my having found a shorter answer, I'll still award a 50 rep bounty to the first other R answer shorter than 88 bytes.

I suppose I'd award myself the bounty if I could, but this is a whole two bytes shorter than the "boring" answer! I avoid rotations by just using R's penchant for recycling.

To get here, I deconstructed the desired output to their ASCII code points with utf8ToInt (removing the newlines), built a matrix, and ran a diff on themm getting the columnwise differences. Noting the periodicity there, I set out to construct the matrix in a golfy fashion, hoping to use diffinv to recreate the original.

Thanks to the periodicity, we can recreate the diffed matrix by forcing R to recycle with a non-multiple length, and extract the columns we actually wanted:

matrix(c(66,-32,-31),25,5,T)[,1:3]

Then we invert this process, with diffinv to recreate the code points, append a row of 10 (newlines) to the bottom, reconvert to ASCII with intToUtf8, and cat the result.

R, 88 86 bytes

cat(intToUtf8(rbind(diffinv(matrix(c(66,-32,-31),25,5,T)[,1:3],,,t(c(32,65,97))),10)))

Try it online!

R is terrible at string manipulation and although it has some neat matrix builtins, rotations are another thing it doesn't do very easily. I will happily give a bounty to anyone who can out-golf me in R.

Despite my having found a shorter answer, I'll still award a 50 rep bounty to the first other R answer shorter than 88 bytes.

I suppose I'd award myself the bounty if I could, but this is a whole two bytes shorter than the "boring" answer! I avoid rotations by just using R's penchant for recycling.

EDIT: user2390246's answer completely outgolfed me and I will be awarding a 100 point bounty since that solution is far superior.

To get here, I deconstructed the desired output to their ASCII code points with utf8ToInt (removing the newlines), built a matrix, and ran a diff on themm getting the columnwise differences. Noting the periodicity there, I set out to construct the matrix in a golfy fashion, hoping to use diffinv to recreate the original.

Thanks to the periodicity, we can recreate the diffed matrix by forcing R to recycle with a non-multiple length, and extract the columns we actually wanted:

matrix(c(66,-32,-31),25,5,T)[,1:3]

Then we invert this process, with diffinv to recreate the code points, append a row of 10 (newlines) to the bottom, reconvert to ASCII with intToUtf8, and cat the result.

added 169 characters in body
Source Link
Giuseppe
  • 28.8k
  • 3
  • 31
  • 105

R, 88 86 bytes

cat(intToUtf8(rbind(diffinv(matrix(c(66,-32,-31),25,5,T)[,1:3],,,t(c(32,65,97))),10)))

Try it online!

R is terrible at string manipulation and although it has some neat matrix builtins, rotations are another thing it doesn't do very easily. I will happily give a bounty to anyone who can out-golf me in R.I will happily give a bounty to anyone who can out-golf me in R.

Despite my having found a shorter answer, I'll still award a 50 rep bounty to the first other R answer shorter than 88 bytes.

I suppose I'd award myself the bounty if I could, but this is a whole two bytes shorter than the "boring" answer! I avoid rotations by just using R's penchant for recycling.

To get here, I deconstructed the desired output to their ASCII code points with utf8ToInt (removing the newlines), built a matrix, and ran a diff on themm getting the columnwise differences. Noting the periodicity there, I set out to construct the matrix in a golfy fashion, hoping to use diffinv to recreate the original.

Thanks to the periodicity, we can recreate the diffed matrix by forcing R to recycle with a non-multiple length, and extract the columns we actually wanted:

matrix(c(66,-32,-31),25,5,T)[,1:3]

Then we invert this process, with diffinv to recreate the code points, append a row of 10 (newlines) to the bottom, reconvert to ASCII with intToUtf8, and cat the result.

R, 88 86 bytes

cat(intToUtf8(rbind(diffinv(matrix(c(66,-32,-31),25,5,T)[,1:3],,,t(c(32,65,97))),10)))

Try it online!

R is terrible at string manipulation and although it has some neat matrix builtins, rotations are another thing it doesn't do very easily. I will happily give a bounty to anyone who can out-golf me in R.

I suppose I'd award myself the bounty if I could, but this is a whole two bytes shorter than the "boring" answer! I avoid rotations by just using R's penchant for recycling.

R, 88 86 bytes

cat(intToUtf8(rbind(diffinv(matrix(c(66,-32,-31),25,5,T)[,1:3],,,t(c(32,65,97))),10)))

Try it online!

R is terrible at string manipulation and although it has some neat matrix builtins, rotations are another thing it doesn't do very easily. I will happily give a bounty to anyone who can out-golf me in R.

Despite my having found a shorter answer, I'll still award a 50 rep bounty to the first other R answer shorter than 88 bytes.

I suppose I'd award myself the bounty if I could, but this is a whole two bytes shorter than the "boring" answer! I avoid rotations by just using R's penchant for recycling.

To get here, I deconstructed the desired output to their ASCII code points with utf8ToInt (removing the newlines), built a matrix, and ran a diff on themm getting the columnwise differences. Noting the periodicity there, I set out to construct the matrix in a golfy fashion, hoping to use diffinv to recreate the original.

Thanks to the periodicity, we can recreate the diffed matrix by forcing R to recycle with a non-multiple length, and extract the columns we actually wanted:

matrix(c(66,-32,-31),25,5,T)[,1:3]

Then we invert this process, with diffinv to recreate the code points, append a row of 10 (newlines) to the bottom, reconvert to ASCII with intToUtf8, and cat the result.

added 169 characters in body
Source Link
Giuseppe
  • 28.8k
  • 3
  • 31
  • 105

R, 8888 86 bytes

cat(" bC#eF&hI)kLintToUtf8(rbind(diffinv(matrix(c(66,nO/qR2tU5wX8z
A!cD$fG'iJ*lM-oP0rS3uV6xY9
aB\"dE%gH32,-31),25,5,T)[,1:3],,,t(jK+mN.pQ1sT4vW7yZ"c(32,65,97))),10)))

Try it online!Try it online!

R is terrible at string manipulation and although it has some neat matrix builtins, rotations are another thing it doesn't do very easily.R is terrible at string manipulation and although it has some neat matrix builtins, rotations are another thing it doesn't do very easily. I will happily give a bounty to anyone who can out-golf me in R.

I will happily give asuppose I'd award myself the bounty to anyone who can out-golf me in Rif I could, but this is a whole two bytes shorter than the "boring" answer! I avoid rotations by just using R's penchant for recycling.

R, 88 bytes

cat(" bC#eF&hI)kL,nO/qR2tU5wX8z
A!cD$fG'iJ*lM-oP0rS3uV6xY9
aB\"dE%gH(jK+mN.pQ1sT4vW7yZ")

Try it online!

R is terrible at string manipulation and although it has some neat matrix builtins, rotations are another thing it doesn't do very easily. I will happily give a bounty to anyone who can out-golf me in R.

R, 88 86 bytes

cat(intToUtf8(rbind(diffinv(matrix(c(66,-32,-31),25,5,T)[,1:3],,,t(c(32,65,97))),10)))

Try it online!

R is terrible at string manipulation and although it has some neat matrix builtins, rotations are another thing it doesn't do very easily. I will happily give a bounty to anyone who can out-golf me in R.

I suppose I'd award myself the bounty if I could, but this is a whole two bytes shorter than the "boring" answer! I avoid rotations by just using R's penchant for recycling.

Source Link
Giuseppe
  • 28.8k
  • 3
  • 31
  • 105
Loading