Learn how to implement and use the floodfill algorithm in Python.
If there is a 50% chance something will go wrong, then 9 times out of 10 it will.