Graphics - Drawing and Filling Circles

For this we have one function which comes in two "flavors" depending on whether the last parameter (color) is present or not.

graph.circle(x, y, r)
graph.circle(x, y, r, color)

In both cases circle is drawn with the center at x, y coordinate, having radius r. If no color is given, only circle's outline is drawn with current color set for lines. Otherwise, with the color parameter supplied, the circle is drawn filled with the given color. Try the following example:

graph.init()
graph.circle(100, 100, 50)
graph.circle(180, 150, 70, 'blue')
graph.color('red')
graph.circle(260, 200, 90)

You should see smaller circle outlined in initial color (presumably, black), the next drawn filled with blue and the last and largest again outlined though in red this time.

For exercise you may try drawing multiple circles using a loop (or two loops) for example to create such patterns. To approach the second one you may utilize if ... then construct and check that, for example, sum of row and column is even, e.g. (row + column) % 2 == 1:

 simpler one           slightly tougher

O O O O O O O           O   O   O   O
O O O O O O O             O   O   O
O O O O O O O           O   O   O   O
...                     ...