Open sunjay opened 6 years ago
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.
The LOGO programming language has a fill command which essentially performs a flood fill starting at the turtle's current position.
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).