Munching squares: Difference between revisions
Content added Content deleted
(→{{header|Evaldraw}}: add image) |
(add bqn) |
||
Line 608: | Line 608: | ||
>2%*28*:**-2/\1-:v<:8:-1<_@ v |
>2%*28*:**-2/\1-:v<:8:-1<_@ v |
||
^\-1*2%2/*:*82::\_$0.0..:^:*<</syntaxhighlight> |
^\-1*2%2/*:*82::\_$0.0..:^:*<</syntaxhighlight> |
||
=={{header|BQN}}== |
|||
Outputs a string that represents a PPM image. |
|||
BQN uses the <code>•bit</code> namespace for native bitwise operations, including casting. An input bit width and output bit width have to be given. |
|||
<syntaxhighlight lang="bqn">nl←@+10 |
|||
XORppm ← { |
|||
g←⥊(0∾∾˜)¨((↕𝕩)16‿16•bit._xor⊢)˘↕𝕩 |
|||
s←•Repr 𝕩 |
|||
h←"P3"∾nl∾s∾" "∾s∾nl∾(•Repr 𝕩-1)∾nl |
|||
h∾∾∾⟜nl¨{¯1↓∾∾⟜' '¨•Repr¨𝕩}¨g |
|||
}</syntaxhighlight> |
|||
Example usage: |
|||
<syntaxhighlight lang="bqn">"xor.ppm" •FChars XORppm 256</syntaxhighlight> |
|||
=={{header|Burlesque}}== |
=={{header|Burlesque}}== |