Mosaic matrix: Difference between revisions

Content added Content deleted
(→‎BQN: add)
(→‎J: simplify)
Line 772: Line 772:


=={{header|J}}==
=={{header|J}}==

Implementation:
Implementation:
<syntaxhighlight lang="j">mosq=:{{0=2|+/~i.y}}</syntaxhighlight>
<syntaxhighlight lang="j">mosq=: [: =/~ 2 | i.</syntaxhighlight>

Examples:
Examples:

<syntaxhighlight lang="j"> mosq 4
<syntaxhighlight lang="j"> mosq 4
1 0 1 0
1 0 1 0