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 circles;
 
extern printf;
 
@Boolean in_circle(@Integer centre_x, @Integer centre_y, @Integer radius, @Integer x, @Integer y) [
	return (x-centre_x)*(x-centre_x)+(y-centre_y)*(y-centre_y) <= radius*radius;
]
 
@Boolean in_big_circle (@Integer radius, @Integer x, @Integer y) [
	return in_circle(0, 0, radius, x, y);
]
 
@Boolean in_while_semi_circle (@Integer radius, @Integer x, @Integer y) [
	return in_circle(0, radius/2, radius/2, x, y);
]
 
@Boolean in_small_white_circle (@Integer radius, @Integer x, @Integer y) [
	return in_circle(0, 0-radius/2, radius/6, x, y);
]
 
@Boolean in_black_semi_circle (@Integer radius, @Integer x, @Integer y) [
	return in_circle(0, 0-radius/2, radius/2, x, y);
]
 
@Boolean in_small_black_circle (@Integer radius, @Integer x, @Integer y) [
	return in_circle(0, radius/2, radius/6, x, y);
]
 
@Void print_yin_yang(@Integer radius) [
	var white = '.';
	var black = '#';
	var clear = ' ';
 
	var scale_y = 1;
	var scale_x = 2;
	for (var sy = radius*scale_y; sy >= -(radius*scale_y); sy=sy-1) {
		for (var sx = -(radius*scale_x); sx <= radius*scale_x; sx=sx+1) {
			var x = sx/(scale_x);
			var y = sy/(scale_y);
 
			if (in_big_circle(radius, x, y)) {
				if (in_while_semi_circle(radius, x, y))
					if (in_small_black_circle(radius, x, y))
						printf("%c", black);
					else
						printf("%c", white);
				else if (in_black_semi_circle(radius, x, y))
					if (in_small_white_circle(radius, x, y))
						printf("%c", white);
					else
						printf("%c", black);
				else 	if (x < 0)
						printf("%c", white);
					else
						printf("%c", black);
			} else printf("%c", clear);
		}
		printf("\n");
	}
]
 
@Integer main [
	print_yin_yang(17);
	print_yin_yang(8);
	return 0;
]