ONE-LINERS: Grow a picture or video from a single line of C or Python code

One-liner picture quiz

Here's an exercise for logical minds.

In one-liner pictures, x and y go from -128 to 127 and they are represented in twos-complement format.

So which piece of code generates which picture? In the following table the expressions and pictures have been mixed up. Try to straighten them out without running the program. Then you can check your answers via the third column if you wish.

x ^ y

x ^ y

x | y

x | y

x >> (y&7)

x >> (y&7)

~(x & y)

~(x & y)

(x & y) >> (x & y & 31)

(x & y) >> (x & y & 31)

John Robinson