One well-known symbol of the philosophy of duality known as yin and yang is the taijitu.



Task

   Create a function that, given a parameter representing size, generates such a symbol scaled to the requested size.
   Generate and display the symbol for two different (small) sizes.


MODULE Taijitu;
FROM InOut IMPORT Write, WriteLn;
 
PROCEDURE YinYang(r: INTEGER);
    VAR x, y: INTEGER;
 
    PROCEDURE circle(x, y, c, r: INTEGER): BOOLEAN;
    BEGIN
        RETURN r*r >= (x DIV 2) * (x DIV 2) + (y-c) * (y-c);
    END circle;
 
    PROCEDURE pixel(x, y, r: INTEGER): CHAR;
    BEGIN
        IF circle(x, y, -r DIV 2, r DIV 6) THEN RETURN '#';
        ELSIF circle(x, y, r DIV 2, r DIV 6) THEN RETURN '.';
        ELSIF circle(x, y, -r DIV 2, r DIV 2) THEN RETURN '.';
        ELSIF circle(x, y, r DIV 2, r DIV 2) THEN RETURN '#';
        ELSIF circle(x, y, 0, r) THEN
            IF x<0 THEN RETURN '.';
            ELSE RETURN '#';
            END;
        ELSE RETURN ' ';
        END;
    END pixel;
BEGIN
    FOR y := -r TO r DO
        FOR x := -2*r TO 2*r DO
            Write(pixel(x,y,r));
        END;
        WriteLn();
    END;
END YinYang;
 
BEGIN
    YinYang(4);
    WriteLn();
    YinYang(8);
END Taijitu.