Skip to main content
deleted 233 characters in body
Source Link
Galen Ivanov
  • 21.2k
  • 3
  • 24
  • 61

J, 1111 8 bytes

-3 bytes thanks to miles

,.~@]];<;._3[_3~,~

Try it online!

Explanation

J has a cut conjunction - ;.

x(u;._3)y applies verb u to each tile of a regular tiling of y specified by x.

So I just needed to form xfrom the input's right argument by laminating (,:) and use the ] verb to display the subarrays.Try it online!

J, 11 bytes

,.~@]];._3[

Try it online!

Explanation

J has a cut conjunction - ;.

x(u;._3)y applies verb u to each tile of a regular tiling of y specified by x.

So I just needed to form xfrom the input's right argument by laminating (,:) and use the ] verb to display the subarrays.

J, 11 8 bytes

-3 bytes thanks to miles

<;._3~,~

Try it online!

Source Link
Galen Ivanov
  • 21.2k
  • 3
  • 24
  • 61

J, 11 bytes

,.~@]];._3[

Try it online!

Explanation

J has a cut conjunction - ;.

x(u;._3)y applies verb u to each tile of a regular tiling of y specified by x.

So I just needed to form xfrom the input's right argument by laminating (,:) and use the ] verb to display the subarrays.