2 ms·
The big expression in the middle is effectively unpacking a 2D point encoded in z. z % 9 is the x coordinate and z / 9 is the y coordinate: x = z % 9; y =
by mmastrac 17y ago
The big expression in the middle is effectively unpacking a 2D point encoded in z. z % 9 is the x coordinate and z / 9 is the y coordinate:
x = z % 9;
y = z / 9;
putchar (
x + y > 3 &&
x + y < 14 &&
y < x + 6 &&
y > x - 5 ? '*' : ' ' );
if (x == 8)
putchar ( '\n' );
Wolfram Alpha plots this inequality nicely:
http://www.wolframalpha.com/input/?i=x+%2B+y+%3E+3+%26%26+x+%2B+y+%3C+14+%26%26+y+%3C+x+%2B+6+%26%26+y+%3E+x+-+5+ http://www.wolframalpha.com/input/?i=x+%2B+y+%3E+3+%26%26+x+...