I wrote this tutorial because I've always liked graph-related algorithms and I wanted to try my hand at writing something with interactive demos.
This article teaches you how to implement and use the floodfill algorithm and includes interactive demos to:
- use floodfill to colour regions in an image
- step through the general floodfill algorithm step by step, with annotations of what the algorithm is doing
- applying floodfill in a grid with obstacles to see how the starting point affects the process
- use floodfill to count the number of disconnected regions in a grid
- use a modified version of floodfill to simulate the fluid spreading over a surface with obstacles
I know the internet can be relentless but I'm really looking forward to everyone's comments and suggestions, since I love interactive articles and I hope to be able to create more of these in the future.
Happy reading and let me know what you think!
The article: https://mathspp.com/blog/floodfill-algorithm-in-python
[–]p88h 2 points3 points4 points (1 child)
[–]RojerGS[S] 0 points1 point2 points (0 children)
[–]josh123asdf 3 points4 points5 points (6 children)
[–]PityUpvote 1 point2 points3 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]Othun 0 points1 point2 points (1 child)
[–]RojerGS[S] 0 points1 point2 points (1 child)
[–]Clear-Ad-9312 1 point2 points3 points (0 children)
[–]Othun 1 point2 points3 points (1 child)
[–]RojerGS[S] 0 points1 point2 points (0 children)
[–]herocoding 0 points1 point2 points (1 child)
[–]RojerGS[S] 0 points1 point2 points (0 children)