bhaveshAn / bucket-file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bucket Fill Exercise

Objective

Imagine you are working on an image editing application. You need to implement a bucket fill tool similar to the one in paint. The user will use the tool by selecting a color and clicking on the canvas. The tool fills the selected region of color with the new color.

When a pixel is filled, all of its neighbors (above, below, left, or right) of the same color must also be filled, as well as their neighbors, and so on, until the entire region has been filled with the new color.

In this exercise, you must write TWO implementations of the tool. Each implementation must be different. It is not required that you invent the solutions yourself. You are encouraged to research the problem. Please write documentation explaining the difference of each implementation, such as when one solution might be more appropriate than the other. Don't forget to validate input. There is one existing test, however, you might consider adding some more. Keep in mind that although the given canvas is small, the solution should be applicable for a real canvas that could have huge resolutions.

Please use python3 to complete this assignment.

Run the solution

python3 bucket_fill.py

Submitted By

Bhavesh Anand

Email | Website | GitHub | LinkedIn

About


Languages

Language:Python 100.0%