Flood Fill
The LOGO programming language has a fill command which essentially performs a flood fill starting at the turtle's current position.
Filling in Solid Shapes
Now that we know how to move the turtle without drawing a line, we can make the turtle go inside a shape that it has drawn. Then we can fill the entire shape with a single color, using the FILL command.
You can think of the FILL command as pouring out a bucket of special paint and flooding the area under the turtle. The paint is special in that it can't flow over pixels that have a different color than the pixel that the turtle is over.
To add this to turtle, add a public fill() method that sends an appropriate drawing command and performs the necessary algorithm to determine the fill. Add the filled area to the drawings as a polygon or using a better representation.
Make sure the fill method has some examples in the examples directory along with some documentation and some tests (if testing would be useful here).
Would this still be useful considering the begin_fill and end_fill methods?
Yes. Those methods do not perform a flood fill. They fill the path that the turtle is currently drawing.
Then shouldn't we name this flood_fill instead? I just think it would be a bit confusing to have fill, begin_fill, and end_fill, like two ways of achieving the same result, which is not the case.
Sure, yeah. That name makes sense too. The fill name was mainly to refer back to the corresponding Logo command. Adherence to that is not mandatory.